Count if formula if sum of two cells is less than 8?

roobydoo

Board Regular
Joined
Aug 11, 2005
Messages
85
Hi,
I need a formula that will look at the sum of the cells in each of two adjacent rows and count it if the sum is less than 8. I can add a hidden column that adds the two numbers and then use that column in my formula to count if the answer is less than 8 but I would rather not add the hidden column. Can someone help me write something so I don't have to add a column? In looking at the selection below, I would have an answer of 2. Thank you in advance for looking at this! Roobydoo


4 5
4 4
4 3
4 4
4 4
4 4
3 4
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try:
{=SUM(IF($A$1:$A$10+$B$1:$B$10<8,1,0))}

This assumes that the numbers are in $A$1:$A$10 and $B$1:$B$10

To enter this formula, write it (without the brackets{}) and press CTRL-SHIFT-ENTER instead of just ENTER.
 
Upvote 0
SUMPRODUCT will also work if you don't want to use an array formula:

=SUMPRODUCT(--(A1:A10+B1:B10 < 8))

If you have empty cells, the formula will need to be:

=SUMPRODUCT(--(A1:A10+B1:B10<8),--(A1:A10+B1:B10<>0))
 
Last edited:
Upvote 0
SUMPRODUCT will also work if you don't want to use an array formula:

=SUMPRODUCT(--(A1:A10+B1:B10 < 8))

If you have empty cells, the formula will need to be:

=SUMPRODUCT(--(A1:A10+B1:B10<8),--(A1:A10+B1:B10<>0))

PERFECT! it works, there are blank cells so I will use that one. Thanks so much, this will save me lots of time.
Rooby
 
Upvote 0
Thanks so much for all the answers. I have so much to learn and I am going to play around with all these suggestions - but it works!
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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