Formula help please

  • Thread starter Thread starter Shawna
  • Start date Start date
S

Shawna

I'm sure this is very simple but I cannot figure it out.
I have one column with a number code. Instead of that
number code, I want it to be what the code stands for.
What kind of forumula can I write for this? If I can't
do it within the same column, I can accept doing it in
another column and copying and pasting.

Any suggestions would be greatly appreciated.

Thank you
Shawna
 
Hi Shawna

don't think you can do it in the same column as code, but if you have a
table with the code in the first column & the data that you want to
substitute for it in another column you can use the VLOOKUP function
e.g. your "lookup" table - assume on sheet2
A B
1 Code Info
2 AAA Animals
3 BBB Birds

the sheet where you want the related data to appear
A B
1 BBB - want "Birds" here

therefore in B1 you can type
=VLOOKUP(A1,Sheet2!$A$2:$B$3,2,0)
this says, lookup the value in A1, in the table in sheet2 and return the
information from the 2nd column where there is an exact match

Hope this helps
Cheers
JulieD
 
sorry forgot to mention that if there is no data in A1 of sheet 1 (where the
VLOOKUP is) the VLOOKUP will return #NA, to supress this adjust the formula
as follows
=IF(ISNA(VLOOKUP(A1,Sheet2!$A$2:$B$3,2,0)),"",VLOOKUP(A1,Sheet2!$A$2:$B$3,2,0))

Cheers
JulieD
 
Also, your table has to be sorted.
-----Original Message-----
sorry forgot to mention that if there is no data in A1 of sheet 1 (where the
VLOOKUP is) the VLOOKUP will return #NA, to supress this adjust the formula
as follows
=IF(ISNA(VLOOKUP(A1,Sheet2!$A$2:$B$3,2,0)),"",VLOOKUP (A1,Sheet2!$A$2:$B$3,2,0))

Cheers
JulieD





.
 
Hi Kevin

not necessary as the match is an exact match (fourth parameter of VLOOKUP =
0 or FALSE) if the fourth parameter is omitted, =1 or is TRUE then it needs
to be sorted

Cheers
JulieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top