# Count If value falls with in a range

Hi,

I'm trying to count, in a range of cells (A1 : A2500), how many fall between certain values, such as between 0 and 1000; 1001 & 5000; 5001 & 6000.

thanks
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
``````=SUMPRODUCT((\$A\$1:\$A\$2500>0)*(\$A\$1:\$A\$2500<=1000))
=SUMPRODUCT((\$A\$1:\$A\$2500>1000)*(\$A\$1:\$A\$2500<=5000))
=SUMPRODUCT((\$A\$1:\$A\$2500>5000)*(\$A\$1:\$A\$2500<=6000))
``````

First one counts 0 - 1000, second one 1001-5000, etc
0
Author Commented:
I think I came up with the same solution:):)

=SUMPRODUCT((A2:A116>=-1000)*(A2:A116<=0))

my next question is how do I sum up values based on this split? So I need to know a total for  values that fall under each category
0
Commented:
If you are using Excel 2007 or later then COUNTIFS is usually faster, e.g.

=COUNTIFS(A1:A2500,">=-1000",A1:A2500,"<=0")

and then to sum those you can use SUMIFS

=SUMIFS(A1:A2500,A1:A2500,">=-1000",A1:A2500,"<=0")

regards, barry
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
For that, you need to define the bands

Say 0 - 1000 is called "1"
next bracket is called "2"
Next is called "3"

Now on B1, enter this

=IF(A1>0,IF(A1<=1000,1,IF(A1<=5000,2,3)))

Drag it down. Then you can do pivot table or do sumif.

=SUMIF(B1:B2500,1,A1:A2500)

would sum all the 1st band/bracket

=SUMIF(B1:B2500,2,A1:A2500)

would sum all the 2nd band/bracket
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.