Insert name

C

Carolan

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
 
N

Norman Harker

Hi Carolan!

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

Norman Harker

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.
 
N

Norman Harker

Hi Carolan!

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

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

Similar Threads


Top