Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
embedding "ISERROR" function into an "IF" statement | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
IF statement does not work with "=" sign | Excel Worksheet Functions | |||
pictures to work with "data" "sort" option | Excel Discussion (Misc queries) |