Compare multiple columns

300m

New Member
Joined
Sep 11, 2011
Messages
23
I would like to compare multiple columns and if all the results below are true, display the output "1" and if one of them is not true display the output "0".


O7>P7
Q7>R7
S7>T7
AA7> AB7
AG7>AH7


I tried with this formula, but it does not work:
=IF(O7>P7,1,IF(Q7>R7,1,IF(S7>T7,1,IF(AA7>AB7,1,IF(AG7>AH7,1,0)))))


Any help much appreciated.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Yes, it works really well. Thank you very much!:)
Why does my formula not work?
 
Upvote 0
If you have Excel 2002 or higher version, have you ever tried stepping through the pieces of your formula using Formula Auditing>Evaluate Formula? That should help you understand the error of your ways. When you're on the cell with formula Excel 2007 use Alt+M+V, in Excel 2002-2003 Tools>Formula Auditing>Evaluate Formula.

Here's what your formula is doing:
O7>P7 then "1" regardless of what is in any of the remaining groups of cells
O7 is NOT > P7 but Q7>R7 then "1" regardless of what is in any of the remaining groups of cells
O7 is NOT > P7 and Q7 is NOT > R7 but S7>T7 then "1" regardless of what is in any of the remaining groups of cells
ect.
 
Upvote 0
I am on excel for mac 2011, not sure but don't think there is a Formula Auditing>Evaluate Formula. Anyway, thanks a lot for your clear explanation, I appreciate your effort.
Have a nice day!
 
Upvote 0

Forum statistics

Threads
1,203,125
Messages
6,053,657
Members
444,676
Latest member
locapoca

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