If/Then statement

A

A Ford

I need a formula that says "If the value in cell C8 is 1, then return $0. If
the value in cell C8 is 2, then return $105. If the value in cell C8 is 3,
then return $390. If the value in cell C8 is 4, then return $675.
 
J

JulieD

Hi

=IF(C8=1,0,IF(C8=2,105,IF(C8=3,390,IF(C8=4,675,"something else"))))

change the "something else" to whatever you want if C8 doesn't fall between
1 & 4 inclusive

OR

=CHOOSE(C8,0,105,390,675)
note, this will return #value if C8 doesn't fall between 1 & 4 inclusive

Cheers
JulieD
 
J

JE McGimpsey

One way:

=CHOOSE(C8,0,105,390,675)

If the value may be outside the range of 1-4:

=IF(AND(C8>=1,C8<=4),CHOOSE(C8,0,105,390,675),"")
 
F

Frank Kabel

Hi
better to use a lookup table for this . e.g. on a separate sheet
(called 'lookup') create the following:
A B
1 1 0
2 2 105
3 3 390
....

Now use the following formula
=VLOOKUP(C8,'lookup'!A1:B10,2,0)
 
Top