View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Maistrye Maistrye is offline
external usenet poster
 
Posts: 1
Default Excel If Statements with more than one Solution


Wrote:
How can I put all of three of these if statements into one cell? For
example I want to say if it equals the 1st one than this is true but if
it equals the 2nd one than this is true, if it equals the 3rd one than
this is true but if it doesnt equal any of them its 0

1st IF statement for
J13: =IF(YEAR($G12)=YEAR(J$12),IF(MONTH($G3)=MONTH(J$12 ),(($D4*$E3)*50%),"
")," ")
2nd IF statement for
J13: =IF(YEAR($G12)=YEAR(F$8),IF(MONTH($G12)=MONTH(F8), (($D12*$E12)*25%),"
")," ")
3rd IF statement for
J13: =IF(YEAR($G12)=YEAR(I$7),IF(MONTH($G12)=MONTH(I$7) ,(($D12*$E12)*25%),"
")," ")



I'm not going to copy what you have, but it's basically like this:

=IF(and([conditionsfor1]),[ResultFor1], IF(and([conditionsfor2]),
[ResultFor2], IF (and[conditionsfor3]), [ResultFor3],
[ResultForNone])))

Where, for example, [conditionsfor1] is
YEAR($G12)=YEAR(F$8),(MONTH($G12)=MONTH(I$7) and [ResultFor1] =
(($D12*$E12)*25%.

Scott


--
Maistrye
------------------------------------------------------------------------
Maistrye's Profile:
http://www.excelforum.com/member.php...o&userid=36078
View this thread: http://www.excelforum.com/showthread...hreadid=563000