#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 95
Default If Statement

I know I'm making this harder than it realy is, but right now I'm stuck. I
need a formula that will perform the following:
IF B4 = X then display "0"
IF C4 = X then display "50"
IF D4 = X then display "125"
IF E4 = X then display "200"

Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default If Statement

=IF(B4="X",0,IF(C4="X",50,IF(D4="X",125,200)))

Dave
--
Brevity is the soul of wit.


"StephanieH" wrote:

I know I'm making this harder than it realy is, but right now I'm stuck. I
need a formula that will perform the following:
IF B4 = X then display "0"
IF C4 = X then display "50"
IF D4 = X then display "125"
IF E4 = X then display "200"

Any help would be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default If Statement

I will assume that there will be only one X

=(B4="X")*0+(C4="X")*50+(D4="X")*125+(E4="X")*200

You don't need any IF statements
--
Gary's Student
gsnu200702


"StephanieH" wrote:

I know I'm making this harder than it realy is, but right now I'm stuck. I
need a formula that will perform the following:
IF B4 = X then display "0"
IF C4 = X then display "50"
IF D4 = X then display "125"
IF E4 = X then display "200"

Any help would be appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default If Statement

If one and only one of the cell B4:E4 will have an X then use
=50*(C4="X")+125*(D4="X")+200*(E4="X")
If it is progressive (one, two, three or four cells can have an X, then
=50*(C4="X")+75*(D4="X")+75*(E4="X")
But in either case you get an X if B is empty. To overcome this use
=IF(COUNTIF(B4:E4,"X"),50*(C4="X")+125*(D4="X")+20 0*(E4="X"),"")

The test is equivalent to =IF(COUNTIF(B4:E4,"X") 0 That is there is one or
more Xs use the formula else display blank

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"StephanieH" wrote in message
...
I know I'm making this harder than it realy is, but right now I'm stuck. I
need a formula that will perform the following:
IF B4 = X then display "0"
IF C4 = X then display "50"
IF D4 = X then display "125"
IF E4 = X then display "200"

Any help would be appreciated.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 620
Default If Statement

=IF(B4="X","0",IF(C4="X","50",IF(D4="X","125",IF(E 4="X","200","answer
undefined"))))

Are you sure that you want the answers to be text strings? If not, take
away the quotes from round the numbers.
--
David Biddulph

"StephanieH" wrote in message
...
I know I'm making this harder than it realy is, but right now I'm stuck. I
need a formula that will perform the following:
IF B4 = X then display "0"
IF C4 = X then display "50"
IF D4 = X then display "125"
IF E4 = X then display "200"

Any help would be appreciated.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 61
Default If Statement

Hi Stephanie,

I don't know if this will help you but, this is what I used myself.

=LOOKUP(B2,{20,40,60,80},{"0","50","125","200"})

--
Newfie


"StephanieH" wrote:

I know I'm making this harder than it realy is, but right now I'm stuck. I
need a formula that will perform the following:
IF B4 = X then display "0"
IF C4 = X then display "50"
IF D4 = X then display "125"
IF E4 = X then display "200"

Any help would be appreciated.

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
Question using dates in a statement Wink20TCU Excel Discussion (Misc queries) 2 January 3rd 07 03:33 PM
SQL concatenation statement CLamar Excel Discussion (Misc queries) 0 June 29th 06 01:58 PM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM


All times are GMT +1. The time now is 07:35 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"