Count help please

RichFost

New Member
Joined
May 13, 2004
Messages
26
o_O Hi all, I'm sure this is easy but.............

I have a range of numbers in cells ranging from 1 to 100. I know how to do a count for those greater than say 40 (COUNTIF(range),"40") and so on but how do I do the same count if I want to specify BETWEEN 40 and 50? This would also apply if I needed to do a sum of the cells fitting in this range.

Thanks in advance
 

Some videos you may like

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Hi,

Try:

=SUMPRODUCT(--(A1:A12>=40),--(A1:A12<=50))
to count

and

=SUMPRODUCT(--(A1:A12>=40),--(A1:A12<=50),A1:A12)
to sum
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
RichFost said:
o_O Hi all, I'm sure this is easy but.............

I have a range of numbers in cells ranging from 1 to 100. I know how to do a count for those greater than say 40 (COUNTIF(range),"40") and so on but how do I do the same count if I want to specify BETWEEN 40 and 50? This would also apply if I needed to do a sum of the cells fitting in this range.

Thanks in advance

=COUNTIF(Range,">="&E2)-COUNTIF(Range,">"&F2)

where E2 and F2 house criterion values like 40 and 50 with E2 <= F2.

Note that the foregoing produces an inclusive between count.

=SUMIF(Range,">="&E2,SumRange)-COUNTIF(Range,">"&F2,SumRange)

for an inclusive between total.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,370
Messages
5,595,774
Members
414,018
Latest member
quang118

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