multiple if's and or

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
510
Office Version
  1. 365
Platform
  1. Windows
how can make e1 to work?
assuming i can add more to the formula later on

test
ABCDE
1if d1=d2 and c1=c2 OR d1=d2 and b1=b2 OR d1=d2 and a1=a2
281310
362740
421111
574110
test
Cell Formulas
RangeFormula
E2:E5E2=IF(AND(D2=1,D3=1,C2=1,C3=1),1, 0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E1:E5Cell Value=1textNO
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
How about
Excel Formula:
=IF(D2=D3,IF(OR(C2=C3,B2=B3,A2=A3),1,0),0)
 
Upvote 0
it is good but i was in a rush to ask so i didn't notice i'd forget to write (sorry!)
if d1=d2=1 and c1=c2=1 OR d1=d2=1 and b1=b2=1 OR d1=d2=1 and a1=a2=1
and
also need only to check if two pairs equals 1 (like: d1=d2=1 and a1=d2=1)
and the formula will return 1(true) even if there's 3 pairs (d1=d2=1, c1=c2=1,b1=b2=1)
 
Last edited:
Upvote 0
In that case how about like
Excel Formula:
=IF(AND(D2=1,D3=1),IF(OR(AND(C2=1,C3=1),AND(B2=1,B3=1)),1,0),0)
 
Upvote 0
can a condition add to it? which if there's 3 pair's (including d2=d3=1) the result will be 0 ?
added a2:a3...
Excel Formula:
=IF(AND(D2=1,D3=1),IF(OR(AND(C2=1,C3=1),AND(B2=1,B3=1),AND(A2=1,A3=1)),1,0),0)
 
Upvote 0
Try
Excel Formula:
=IF(AND(D2=1,D3=1),IF(--(((AND(C2=1,C3=1))+(AND(B2=1,B3=1))+(AND(A2=1,A3=1)))=1),1,0),0)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,846
Members
449,194
Latest member
HellScout

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