#1   Report Post  
A Ford
 
Posts: n/a
Default 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.
  #2   Report Post  
JulieD
 
Posts: n/a
Default

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.



  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

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.

  #4   Report Post  
Frank Kabel
 
Posts: n/a
Default

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.


  #5   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

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.



  #6   Report Post  
 
Posts: n/a
Default

=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.
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Statement and Excel DavidM Charts and Charting in Excel 3 January 7th 05 12:53 PM
=IF statement Dick Excel Discussion (Misc queries) 10 November 27th 04 02:47 PM
The "Open" statement carl0s66 Excel Discussion (Misc queries) 1 November 26th 04 04:26 PM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"