Shortcut for "OR" function

snjpverma

Well-known Member
Joined
Oct 2, 2008
Messages
1,454
Office Version
  1. 365
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:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
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,454
Office Version
  1. 365
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,210
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.
 

Forum statistics

Threads
1,172,040
Messages
5,878,855
Members
433,380
Latest member
Hadfield

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