Calculate multiple rows of data then sum the results

-Wayner-

Board Regular
Joined
Feb 8, 2008
Messages
84
Hello,

I have a feeling this may be a relatively simple one, but as someone who just never quite gets array formulas I'm struggling to work it out!

I'd like to evaluate a series of subtractions and then count the results. So I have two columns of data, each of containing 10 rows (as an example), each cell containing an integer between 1 and 10. For each row I'd like to subtract one cell from the other on that row (A1 - A2, B1- B2, etc.) then do a count based on the results at the end.

So count of results from the 10 calculations that are less than 0, between 1 and 2 etc.

I know I could do this by doing the calcs in a separate column then counting on the third column, but I feel it should be do-able in one place!

Appreciate any advice on this.

Many thanks,
Wayner
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
This one would work for less than 0:

=COUNT(IF(A1:A10-B1:B10<0,))

Or between 1 & 2 inclusive:

=COUNT(IF(A1:A10-B1:B10>=1,IF(A1:A10-B1:B10<=2,)))
 
Upvote 0
Or these which don't need array entry:

=SUMPRODUCT(--(A1:A10-B1:B10<0))
=SUMPRODUCT(--(A1:A10-B1:B10>=1),--(A1:A10-B1:B10<=2))
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

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