Thread: If statements
View Single Post
  #5   Report Post  
ww
 
Posts: n/a
Default

You would have to subtract out the first condition. If you put the
<=15 formula in say cell G2. For the <=30 formula just put
=countif(A1:A100,"<=30")-G2 into cell G3. It will count all the
numbers <=30 and then subtract the amount that are <=15 so
in a sense you will just end up with numbers beween 16-30. If you then
want numbers between 31-45 in G4 you could put
=countif(A1:A100,"<=45")-sum(G2:G3)

"Metalteck" wrote:

This works well for the first sitution, 0-15, but if i use the other; <=30,
this also counts the first condition. How do I only count for the specified
conditons without overlapping?

"ww" wrote:

Assuming you don't have any negative numbers you could use a countif()
=countif(A1:A100,"<=15") would return the count of numbers between 0 - 15
for numbers between 16-30 you could use
=countif(A1:A100,"<=30")-countif(A1:A100,"<=15")


"Metalteck" wrote:

I have a column with various numbers. I want to be able to count certain
numbers, such as 0-15,16-30, and so on.

I want to be able to write an if statetment that says if a number is between
0 and 15, count it as a 1, 16-30 counted as a 2.

Then need to perform a specific count for just 1's, 2s,....

Can you help me