Shortcut for "OR" function

snjpverma

Well-known Member
Joined
Oct 2, 2008
Messages
1,384
Office Version
  1. 2016
Platform
  1. Windows
4449
3121
2244
2321
3346
4821
4334
2144
2540
2034

<tbody>
</tbody>

I have my data as shown above in column A & B respectively. I want a formula to be put "C1". if any of the value in column B1:B10 is greater than Column A1:A10 respectively then it should return as "Greater". (for e.g. if B1>A1 or B2>A2, and so on. Also, for A11 to A15 I am using the sum amount to compare as shown in bold in below formula. Currently I am using the below formula which becomes very big if applied for 10 rows. Please help with a better formula.

=IF(OR(B1>A1,B2>A2,B3>A3,B4>A4,B5>A5,B6>A6,B7>A7,B8>A8,B9>A9,B10>A10,SUM(B11:B15)>SUM(A11:A15)),"Greater","Perfect")
 
Last edited:

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,203
In C1 control+shift+enter, not just enter:

=IF(OR(A1:A10>B1:B10,IF(ISNUMBER(B11:B15),SUM(B11:B15)>SUM(A11:A15),FALSE)),"at least one A-value is greater or sum of b11:b15 is greater than sum of a11:a15","perfect")

although I fail to see the objective.<strike></strike>
 

snjpverma

Well-known Member
Joined
Oct 2, 2008
Messages
1,384
Office Version
  1. 2016
Platform
  1. Windows
In C1 control+shift+enter, not just enter:

=IF(OR(A1:A10>B1:B10,IF(ISNUMBER(B11:B15),SUM(B11:B15)>SUM(A11:A15),FALSE)),"at least one A-value is greater or sum of b11:b15 is greater than sum of a11:a15","perfect")

although I fail to see the objective.<strike></strike>

thank you for suggesting a much shorter formula. However, I fail to understand why you used the ISNUMBER FUNCTION. Getting hint from your formula I shortened it even more as shown below. It works too. Please advise if any drawbacks of the below formula.
=IF(OR(B1:B10>A1:A10,SUM(B11:B15)>SUM(A11:A15)),"Greater","Perfect")
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,203
thank you for suggesting a much shorter formula. However, I fail to understand why you used the ISNUMBER FUNCTION. Getting hint from your formula I shortened it even more as shown below. It works too. Please advise if any drawbacks of the below formula.
=IF(OR(B1:B10>A1:A10,SUM(B11:B15)>SUM(A11:A15)),"Greater","Perfect")

Hint? But reducing the IF bit to just SUM(B11:B15)>SUM(A11:A15) is ok. The objective is still not clear.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,867
Messages
5,627,354
Members
416,244
Latest member
JBKool

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
Top