# Shortcut for "OR" function

#### snjpverma

##### Well-known Member
 44 49 31 21 22 44 23 21 33 46 48 21 43 34 21 44 25 40 20 34

<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

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.

##### MrExcel MVP
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
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")

##### MrExcel MVP
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.

Replies
1
Views
59
Replies
6
Views
67
Replies
23
Views
275
Replies
7
Views
198
Replies
3
Views
97

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.

### Which adblocker are you using?

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

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