View Single Post
  #3   Report Post  
Ken Wright
 
Posts: n/a
Default

Another way is to use VLOOKUP and build a table with all the possible inputs
and then map against it the required outputs, eg

Apple Fruit
Pear Fruit
Plum Fruit
Carrot Veg
Bean Veg
Bun Pastry
Cake Pastry
Donut Pastry

usually easier to maintain depending on list sizes

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------


"KL" wrote in message
...
One way:

=CHOOSE(OR(A4={"apple","pear","plum"})+OR(A4={"car rot","bean"})*2+OR(A4={"bun","cake","donut"})*3+1, A4,"fruit","veg","pastry")

Regards,
KL



"Jocko_MacDuff116" wrote in
message ...
Does anyone know how to build a formula as follows

if(a4='apple' or 'pear' or 'plum', then 'fruit' else
if(a4='carrot' or 'bean', then 'veg' else
if(a4='bun' or 'cake' or 'donut' then 'pastry' else a4)))

I have been unable to find satisfactory info re or & and as part
of
functions.