COUNT BETWEEN A RANGE AND

D

Dave

HI

I WOULD LIKE TO COUNT VALUES BETWEEN A RANGE. THE FORMULA I HAVE TRIED TO
USE IS: COUNTIF(D:D,">30000AND<75000") TO GET THE NUMBER OF VALUES BETWEEN 30
AND 75, HOWEVER, THIS DOES NOT WORK. CAN SOMEONE HELP?

ALSO, ON TOP OF THIS I WOULD LIKE TO COUNT A STATEMENT IN ANOTHER COLUMN
WHICH SAYS YES OR NO. SO THAT FROM THE VALUES BETWEEN 30 AND 75 I WOULD LIKE
TO KNOW WHICH ONES ARE ALSO YES AND NO. ANYONE WHO CAN HELP ME MUCH
APPRECIATED
 
J

Jacob Skaria

Either use
=COUNTIF(D:D,">30000")-COUNTIF(D:D,">75000")

OR
=SUMPRODUCT(--(D1:D1000>30000),--(D1:D1000<75000))

With another condition
=SUMPRODUCT(--(C1:C1000="Y"),--(D1:D1000>30000),--(D1:D1000<75000))

=SUMPRODUCT(--(C1:C1000="N"),--(D1:D1000>30000),--(D1:D1000<75000))
 
J

Jacob Skaria

Either use
=COUNTIF(D:D,">30000")-COUNTIF(D:D,">75000")

OR
=SUMPRODUCT(--(D1:D1000>30000),--(D1:D1000<75000))

With another condition
=SUMPRODUCT(--(C1:C1000="Y"),--(D1:D1000>30000),--(D1:D1000<75000))

=SUMPRODUCT(--(C1:C1000="N"),--(D1:D1000>30000),--(D1:D1000<75000))
 
D

Dave

Hi Jacob

Thanks for this.

The SUMPRODUCT formula doesn seem to be working as it stands. What do the 2
hyphens represent~?
 
D

Dave

Hi Jacob

Thanks for this.

The SUMPRODUCT formula doesn seem to be working as it stands. What do the 2
hyphens represent~?
 
D

Dave

Hi

The formula works now for values between 30k and 75k as I have put these
values to record the correct amount of rows, however, the formula:
=SUMPRODUCT(--(C1:C1000="N"),--(D1:D1000>30000),--(D1:D1000<75000)) does not
work, I have written it as:
=SUMPRODUCT(--(F1:F5000="Yes"),--(D1:D5000>30000),--(D1:D5000<75000)) and
this records a value of 256 (which is wrong) it sould be 324. If I change it
to "No" it records a value of 1,014 (again incorrect) it should 948.
 
D

Dave

Hi

The formula works now for values between 30k and 75k as I have put these
values to record the correct amount of rows, however, the formula:
=SUMPRODUCT(--(C1:C1000="N"),--(D1:D1000>30000),--(D1:D1000<75000)) does not
work, I have written it as:
=SUMPRODUCT(--(F1:F5000="Yes"),--(D1:D5000>30000),--(D1:D5000<75000)) and
this records a value of 256 (which is wrong) it sould be 324. If I change it
to "No" it records a value of 1,014 (again incorrect) it should 948.
 
D

Dave

MY APOLOGIES!!! IT DOES WORK!!

THANKS!!

Dave said:
Hi

The formula works now for values between 30k and 75k as I have put these
values to record the correct amount of rows, however, the formula:
=SUMPRODUCT(--(C1:C1000="N"),--(D1:D1000>30000),--(D1:D1000<75000)) does not
work, I have written it as:
=SUMPRODUCT(--(F1:F5000="Yes"),--(D1:D5000>30000),--(D1:D5000<75000)) and
this records a value of 256 (which is wrong) it sould be 324. If I change it
to "No" it records a value of 1,014 (again incorrect) it should 948.
 
D

Dave

MY APOLOGIES!!! IT DOES WORK!!

THANKS!!

Dave said:
Hi

The formula works now for values between 30k and 75k as I have put these
values to record the correct amount of rows, however, the formula:
=SUMPRODUCT(--(C1:C1000="N"),--(D1:D1000>30000),--(D1:D1000<75000)) does not
work, I have written it as:
=SUMPRODUCT(--(F1:F5000="Yes"),--(D1:D5000>30000),--(D1:D5000<75000)) and
this records a value of 256 (which is wrong) it sould be 324. If I change it
to "No" it records a value of 1,014 (again incorrect) it should 948.
 
D

Dave Peterson

Check your data.

Either your values aren't what you think they are or maybe you have hidden
rows???

Maybe you could add another column with a formula to help you find the
mismatches:

Insert a new column G and put this in G1:
=(f1="yes")&"--"&(d1>30000)&"--"&(d1<75000)
And drag down.

Now find one of the rows that you think should be counted and you should see
TRUE--TRUE--TRUE.

Your job will be to find the rows that aren't all true and determine why.

I'm betting either typing mistakes (extra characters in column F) or text that
looks like numbers in column D.
 
D

Dave Peterson

Check your data.

Either your values aren't what you think they are or maybe you have hidden
rows???

Maybe you could add another column with a formula to help you find the
mismatches:

Insert a new column G and put this in G1:
=(f1="yes")&"--"&(d1>30000)&"--"&(d1<75000)
And drag down.

Now find one of the rows that you think should be counted and you should see
TRUE--TRUE--TRUE.

Your job will be to find the rows that aren't all true and determine why.

I'm betting either typing mistakes (extra characters in column F) or text that
looks like numbers in column D.
 
D

Dave

Everything is working fine. Thanks!

Dave Peterson said:
Check your data.

Either your values aren't what you think they are or maybe you have hidden
rows???

Maybe you could add another column with a formula to help you find the
mismatches:

Insert a new column G and put this in G1:
=(f1="yes")&"--"&(d1>30000)&"--"&(d1<75000)
And drag down.

Now find one of the rows that you think should be counted and you should see
TRUE--TRUE--TRUE.

Your job will be to find the rows that aren't all true and determine why.

I'm betting either typing mistakes (extra characters in column F) or text that
looks like numbers in column D.
 
D

Dave

Everything is working fine. Thanks!

Dave Peterson said:
Check your data.

Either your values aren't what you think they are or maybe you have hidden
rows???

Maybe you could add another column with a formula to help you find the
mismatches:

Insert a new column G and put this in G1:
=(f1="yes")&"--"&(d1>30000)&"--"&(d1<75000)
And drag down.

Now find one of the rows that you think should be counted and you should see
TRUE--TRUE--TRUE.

Your job will be to find the rows that aren't all true and determine why.

I'm betting either typing mistakes (extra characters in column F) or text that
looks like numbers in column D.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top