Excel DB alike?

S

SEOJAPAN

Hi!

An amateur question: can someone help me getting a good tutorial or the
neccesary information for filling row B automatically depending on the
data on row A?
For example:
If row A says:
Dog
Carrot
Apple
Orange
Cat
Horse

I would like row B to be automatically filled with:
animal
vegetable
fruit
fruit
animal
animal

* Notice that the order on A doesn't follow a pattern

Thanks!
SSJ
 
J

JulieD

Hi

if you have a table somewhere in your workbook that lists the options and
what they relate to, then in your column B you can use the VLOOKUP function
to create the table (say on sheet 2) type
..........A..............B
1.....Object.....Classification
2.....Dog.........Animal
3.....Cat..........Animal
4.....Horse......Animal
5......Carrot....Vegetable
etc

then on sheet 1, in cell B2 use the following formula
=VLOOKUP(A2,Sheet2!$A$2:$B$5,2,0)
which says, find the value entered in A2 in the first column of the table in
sheet 2 and return the associated information from the 2nd column where
there is an exact match.

If there is no match or nothing in A2 the formula will return a #NA error -
to deal with this
=IF(ISNA(VLOOKUP(A2,Sheet2!$A$2:$B$5,2,0)),"",VLOOKUP(A2,Sheet2!$A$2:$B$5,2,0))
this formula can then be copied down for all rows in column B
 
Top