Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to combine "IF" functions

I have this function =IF(L9="w1",5,0) to test a cell for the text "w1" and
return value 10 if true, value 0 if false. This works as I want it to.

Now I want to test the same cell for text "w2" and return 10 if true. As a
stand-alone operation this would be =IF(L9="w2",10,0).

How can I combine these two functions in a single statement to test the cell
for either "w1" or "w2" returning either 5 or 10, and 0 if false?

Brian


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default How to combine "IF" functions

=IF(L9="w1",5,IF(L9="w2",10,0))

"BeeCee" wrote:

I have this function =IF(L9="w1",5,0) to test a cell for the text "w1" and
return value 10 if true, value 0 if false. This works as I want it to.

Now I want to test the same cell for text "w2" and return 10 if true. As a
stand-alone operation this would be =IF(L9="w2",10,0).

How can I combine these two functions in a single statement to test the cell
for either "w1" or "w2" returning either 5 or 10, and 0 if false?

Brian



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default How to combine "IF" functions

Try one of these:

=IF(L9="w1",5,IF(L9="w2",10,0))

=(L9="w1")*5+(L9="w2")*10

--
Biff
Microsoft Excel MVP


"BeeCee" wrote in message
a...
I have this function =IF(L9="w1",5,0) to test a cell for the text "w1" and
return value 10 if true, value 0 if false. This works as I want it to.

Now I want to test the same cell for text "w2" and return 10 if true. As
a stand-alone operation this would be =IF(L9="w2",10,0).

How can I combine these two functions in a single statement to test the
cell for either "w1" or "w2" returning either 5 or 10, and 0 if false?

Brian



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default How to combine "IF" functions

"BeeCee" wrote...
....
How can I combine these two functions in a single statement to test the
cell for either "w1" or "w2" returning either 5 or 10, and 0 if false?

....

Another alternative that arguably extends to more cases more easily than the
other responses others have given.

=SUMPRODUCT((L9={"w1";"w2"})*{5;10})


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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Combine logical formulas "if", "and", "or" pscu Excel Discussion (Misc queries) 5 November 2nd 06 07:43 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
can we convert "2 days 16 hrs" to " 64hrs" using excel functions chris Excel Worksheet Functions 5 April 24th 06 12:53 AM


All times are GMT +1. The time now is 12:33 PM.

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"