Multiple If/And/Or Conditions in the Same Cell

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I need to interrogate several conditions within the same cell. I've been able to create individual formulas to come up with the answers I expect, but when I try to concatenate those formulas into a single formula, I don't get the expected values. I'm not overly familiar with nesting If/And/or statements; but here are the 2 core formulas I'm trying to concatenate and a dummy table. Note that the word "spaces" is a placeholder, and in the formula it's actually 5 spacebar strokes.
'=IF(OR(AC2="!",AC2="3",AE2="3")*AND(AD2<>"",AD2<>" "),"Y","N")
'=IF(AND(OR(AC4<>"!",AC4<>"3",AE4<>"3")*AND(AD4<>"",AD4<>" ")),"Y","N")
ACADAEAL
!Spaces0Y
3Spaces5Y
0Spaces3Y
0124Y
5456782Y
6Null9N
4Spaces8N
!123455N
3567896N
0895113N
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
See if this does what you need. Are you sure that you want "3" and not just 3 ? A number enclosed in double quotes is text, not a number, the 2 are not directly comparable. =IF("3"<>3 will return TRUE, =IF("3"=3 will return FALSE.

=IF(OR(AND(OR(AC2="!",AC2="3",AE2="3"),AD2<>"",AD2<>" "),AND(OR(AND(AC4<>"!",AC4<>"3"),AE4<>"3"),AD4<>"",AD4<>" ")),"Y","N")

One more point to note from your formulas, OR(AC4<>"!",AC4<>"3",AE4<>"3") having 2 <> criteria for the same cell with OR serves no purpose, one of them will always be TRUE.
 
Upvote 0
Unfortunately the formula provided didn't work. Great point about the double OR. I decided to employ helper columns to get the result I need. Many thanks for the feedback!!!
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,680
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top