![]() |
Nested If statement revisited
Please forgive my ignorance, I am new to this. My question is almost identical to the previous post, but I was unable to understand that answer. My problem is that I have two ifs that need to be satisfied before returning an answer. Example: If B10="X" and A2B2 then 2*A2 If B10="X" and B2A2 then 2*B2 If B10 doesn not = "X" then 0 I know how to write the simple version =IF((B10="X"),2*A2,0) but I'm not sure where to place the extra argument or what term to use to add another one. (& or AND or whatever). I've tried them all....except the right one, apparently. Someone suggested VLOOKUP tables and I looked that up in my manual but it seems to indicate referencing a set table which this does not seem to have. Perhaps I don't understand correctly. In any event, the first scenario I mentioned is easier to understand, if I can just figure out how to include one more argument. Any ideas? Thanks so much. -- pdgood ------------------------------------------------------------------------ pdgood's Profile: http://www.excelforum.com/member.php...o&userid=31623 View this thread: http://www.excelforum.com/showthread...hreadid=516661 |
Nested If statement revisited
I think this method will save you a step or two: =IF(B10="X",2*MAX(A2:B2),0) OR you could even go this way: =(B10="X")*MAX(A2:B2)*2 Does that help? Regards, Ron -- Ron Coderre ------------------------------------------------------------------------ Ron Coderre's Profile: http://www.excelforum.com/member.php...o&userid=21419 View this thread: http://www.excelforum.com/showthread...hreadid=516661 |
Nested If statement revisited
One way:
=IF(B10="X", IF(A2B2, 2*A2, 2*B2), 0) However, you could simplify that as =IF(B10="X", 2 * MAX(A2,B2), 0) And since XL coverts TRUE/FALSE values to 1/0, respectively, in math operations, you could simplify this a bit mo =(B10<"X") * 2 * MAX(A2,B2) In article , pdgood wrote: Please forgive my ignorance, I am new to this. My question is almost identical to the previous post, but I was unable to understand that answer. My problem is that I have two ifs that need to be satisfied before returning an answer. Example: If B10="X" and A2B2 then 2*A2 If B10="X" and B2A2 then 2*B2 If B10 doesn not = "X" then 0 I know how to write the simple version =IF((B10="X"),2*A2,0) but I'm not sure where to place the extra argument or what term to use to add another one. (& or AND or whatever). I've tried them all....except the right one, apparently. Someone suggested VLOOKUP tables and I looked that up in my manual but it seems to indicate referencing a set table which this does not seem to have. Perhaps I don't understand correctly. In any event, the first scenario I mentioned is easier to understand, if I can just figure out how to include one more argument. Any ideas? Thanks so much. |
Nested If statement revisited
You guys are amazing! And the response time in this forum is unbelieveable. Many, many thanks. -- pdgood ------------------------------------------------------------------------ pdgood's Profile: http://www.excelforum.com/member.php...o&userid=31623 View this thread: http://www.excelforum.com/showthread...hreadid=516661 |
Nested If statement revisited
Of course the "<" should have been "=".
In article , JE McGimpsey wrote: And since XL coverts TRUE/FALSE values to 1/0, respectively, in math operations, you could simplify this a bit mo =(B10<"X") * 2 * MAX(A2,B2) |
All times are GMT +1. The time now is 02:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com