IF statements

  • Thread starter Thread starter user21
  • Start date Start date
U

user21

I have a Category, Color (Red, Blue, Green and Black) and each color
corresponds to a certain figure (e.g. Red=10 Blue=20...and so on). What
i did was create If statements within each other, like
=IF(Color="Red",10,IF(Color="Blue"=20,IF...) But it doesnt seem to
work. Ive used this before but it doenst work this time. Do i have to
define the Color category to include all the colors i want? And if so,
how do i go abt doing it? Thanks
 
You could create a table of your colors with values and then use the
Vlookup() function to refer to the appropriate color code; Also the
Choose() function is another possibility. I could send you a few examples
(in a file) upon request.
 
user21

Assuming the Color is in C2 use this in D2:

=IF(C2="Red",10,IF(C2="Blue",20,IF(C2="Green",30,IF(C2="Black",40))))

Andy.
 
Thanks Andy, that solved the problem. Wasnt quite what I wanted, but it
works! Thanks again. But, If i use Vlookup to define the color table,
would that work?
 
Back
Top