SOLVED

Excel VLOOKUP (RECHERCHEV) help

Copper Contributor

Hi, I don't know if there's french speaking people here so to be sure I'll write the question in both languages. 

Bonjour, je ne sais pas s'il y a des français ici alors je mets la question en français et en anglais. :) 

 

[FR]

En gros j'ai un tableau avec prénoms, date de naissance, age et catégorie.
L'âge est calculé en fonction de la date de naissance avec la fonction DATEDIF. Aucun soucis.

Par contre j'ai un tableau avec les catégories mais sur une autre feuille.

Je dois utiliser la fonction RECHERCHEV et j'imagine INDIRECT, pour aller choper les infos nécessaires.

Seulement je tombe sur une erreur #REF!, mais je ne comprends pas vraiment d'où vient l'erreur.

Ici le résultat devrait être "VETERAN".

Je vous envoie des screens des écrans en question.

 

Merci d'avance ! 

 

[ENG]

To make it short, I have a table with surnames, date of birth, age and category.
The ages are calculated using the DATEDIF function. No problem.

I have a table with the different categories on another sheet.

I must use the RECHERCHEV (VLOOKUP in english ?) function and INDIRECT I think to get the informations needed.
But I get #REF! error, but I don't really get why.

Here the result should be "VETERAN"

I send you screens of the sheets.

Thanks in advance !

 

Annotation 2020-05-11 175653.pngAnnotation 2020-05-11 175906.png

 

7 Replies

@Taytoutay 

Why use INDIRECT? The formula below should work just fine, provided that the ages in the"Age" and "Categorie" sheets are of the same data types.

 

=RECHERCHEV(C2;Tableau5[#Tout];2;VRAI)

 

 

 

Hi, I used it because I tried it without, exactly the same formula you've given me but I got the same error. I thought using indirect might force the formula to take the table in the sheet I wanted.

What do you mean by same type of data ?

@Taytoutay By "data types" I mean that if the lookup value (i.e. C2) is a number, the first column in "Tableau5" must also contain numbers. The may look like numbers, but perhaps they are in fact texts. If so, VLOOKUP will return an error #NA!

 

@Riny_van_Eekelen Thanks for your response, but after verification,  it seems like it already is a number in both cases. And the formula still sends me to "#REF". :\ 

 

I'm joining the file. Could you check what's wrong please ? If you have time of course. :) 

 

I just changed the table name by "cat". 

 

Thanks for your help 

best response confirmed by Taytoutay (Copper Contributor)
Solution

@Taytoutay Have a look at the attached file. Couldn't see that you first table  is also a structured table. It becomes a bit different then, but I could build the formula just by pointing at C2 and it automatically becomes [@AGE], which means "the value in this row in the column named AGE".

 

You solved it thanks ! I didn't know about the @AGE thing, you learn me something ! Thanks a lot ! :D

@Taytoutay Glad I could help.

1 best response

Accepted Solutions
best response confirmed by Taytoutay (Copper Contributor)
Solution

@Taytoutay Have a look at the attached file. Couldn't see that you first table  is also a structured table. It becomes a bit different then, but I could build the formula just by pointing at C2 and it automatically becomes [@AGE], which means "the value in this row in the column named AGE".

 

View solution in original post