If/Then statement
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. |
Hi
=IF(C8=1,0,IF(C8=2,105,IF(C8=3,390,IF(C8=4,675,"so mething 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 "A Ford" <A wrote in message ... 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. |
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),"") In article , A Ford <A wrote: 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. |
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) -- Regards Frank Kabel Frankfurt, Germany "A Ford" <A schrieb im Newsbeitrag ... 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. |
One way
=VLOOKUP(C8,{1,0;2,105;3,390;4,675},2,0) Regards, Peo Sjoblom "A Ford" wrote: 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. |
=if(c8=1,0,if(c8=2,105,IF(c8=3,390,if(c8=4,675,"") )))
-----Original Message----- 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. . |
All times are GMT +1. The time now is 07:44 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com