Insert name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a formula that would look in column A and if the name "CAT" appears insert code 200 in Column B beside CAT?

Example: If CAT appears in Column A, insert code 200 in column B.
If DOG appears in Column A, insert code 201 in column B
If MOUSE appears in Column A, insert Code 203 in colmnn B
Result should look like the following:
A B
Cat 200
Dog 201
Mouse 203
Cat 200
Mouse 203
 
Hi Carolan!

Use a VLOOKUP table. See Help on the function. In this case you need a
final argument of FALSE.
 
Hi Carolan!

First set up your table of conversions in (say J1:K10)

J K
Cat 200
Dog 201
etc.

Assuming the name is input in A1:

=VLOOKUP(A1,$J$1:$K$10,2,FALSE)

The formula is saying, "Look up the entry in A1 in the table which is
in J1:K10, and take the entry in the second column. Only look up exact
matches."

I've used absolute referencing for the VLOOKUP table reference as this
allows you to copy the formula down.
 
Hi Carolan!

Never a problem here with asking for explanations or further help.
 
Back
Top