Question Locked

Excel 2003 formula

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am having trouble with a formula. I am trying to write a formula that when someone selects an item from a drop down list in cell C14 that this cell will change to a corasponding number. I can't find any conditional formulas that will change from many variables. It seems logical (to me the person who has used this program for a couple of weeks) that the formula would read like =(if(C14="Phoenix",5.62,0)OR(C14="Tuscon",8.75,0)OR(C14="Flagstaff",5.84,0))
but that is obviously not working so what are my options?
Thanks in advance,
Ian

4 replies

by __techne__

It seems that right formula is be

=if(C14="Phoenix";5.62;if(C14="Tuscon";8.75;if(C14="Flagstaff";5.84;0)))

In case of multiple "if" you should include "if" after second semi-colon in operator which executes if condition is FALSE.

This also depends on your locale. For example on my computer it is correct to write:
=if(C14="Phoenix";5,62;if(C14="Tuscon";8,75;if(C14="Flagstaff";5,84;0)))

Hope this will help you
Good luck with excel :-)

by fwang

You can use IF function if you only have a few values to map. Otherwise, I will suggest to use VLOOKUP, you can put the keywork (Names) and numbers in two columns (can be in the same worksheet or another worksheet, you can hide them if you want), the use VLOOKUP to get the corresponding value according to the cell with droplist.

For example, if you put the Names in colume G and numbers in columne H, then you can use:
=VLOOKUP(C14,G:H,2,FALSE)
to get the value.

by smugybear

Thank you both! It finally works! haha! And here I was getting so frustrated with the help trying to figure it out!

This discussion is closed to new replies.