![]() |
Having "Or" in an If statement doesn't work?
I was trying this statement:
If a = 2 or b =2 then ..... But the b = 2 doesn't get tested for some reason, why is that? |
Having "Or" in an If statement doesn't work?
One way:
=IF(OR(A2=2,B2=2),TRUE,FALSE) HTH, Paul "J@Y" wrote in message ... I was trying this statement: If a = 2 or b =2 then ..... But the b = 2 doesn't get tested for some reason, why is that? |
Having "Or" in an If statement doesn't work?
On Jun 15, 11:13 am, J@Y wrote:
I was trying this statement: If a = 2 or b =2 then ..... But the b = 2 doesn't get tested for some reason, why is that? It will work in VBA, but not in a cell formula. In a cell the format is: =IF(OR(A=2,B=2),[do if true],[do if false]) Mark Lincoln |
Having "Or" in an If statement doesn't work?
Hi,
It's not clear from your question whether you are doing this in the spreadsheet or in code. IF in code: IF a=2 OR b=2 then ... End IF or IF a=2 XOR b=2 then .... End IF In the spreadsheet there is no XOR option you would need to make a more complicated formula. -- Cheers, Shane Devenshire "J@Y" wrote: I was trying this statement: If a = 2 or b =2 then ..... But the b = 2 doesn't get tested for some reason, why is that? |
All times are GMT +1. The time now is 03:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com