ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Countif Question (https://www.excelbanter.com/excel-worksheet-functions/244301-countif-question.html)

b4nature

Countif Question
 
How do I get a formula to automatically update to count the number of times a
changing value exists within the same range of cells?

Example:
If my range needs to always be B2:F350, how can I count within that range
how many times the number 1 appears, then 2, then 3, etc.

I have COUNTIF($B$2:$F$350,"=1") but I don't want to have to change the
number every time. I want to copy down so the 1 automatically changes to 2
then 3...

Thanks!

Teethless mama

Countif Question
 
COUNTIF($B$2:$F$350,ROW(A1))


"b4nature" wrote:

How do I get a formula to automatically update to count the number of times a
changing value exists within the same range of cells?

Example:
If my range needs to always be B2:F350, how can I count within that range
how many times the number 1 appears, then 2, then 3, etc.

I have COUNTIF($B$2:$F$350,"=1") but I don't want to have to change the
number every time. I want to copy down so the 1 automatically changes to 2
then 3...

Thanks!


Glenn

Countif Question
 
b4nature wrote:
How do I get a formula to automatically update to count the number of times a
changing value exists within the same range of cells?

Example:
If my range needs to always be B2:F350, how can I count within that range
how many times the number 1 appears, then 2, then 3, etc.

I have COUNTIF($B$2:$F$350,"=1") but I don't want to have to change the
number every time. I want to copy down so the 1 automatically changes to 2
then 3...

Thanks!


Try this:

=COUNTIF($B$2:$F$350,ROW(1:1))

Gary''s Student

Countif Question
 
In the very first row in some column enter:

=COUNTIF($B$2:$F$350,ROW()) and copy down
--
Gary''s Student - gsnu200906


"b4nature" wrote:

How do I get a formula to automatically update to count the number of times a
changing value exists within the same range of cells?

Example:
If my range needs to always be B2:F350, how can I count within that range
how many times the number 1 appears, then 2, then 3, etc.

I have COUNTIF($B$2:$F$350,"=1") but I don't want to have to change the
number every time. I want to copy down so the 1 automatically changes to 2
then 3...

Thanks!


T. Valko

Countif Question
 
In what cells do you want the results to appear?

Let's assume you want the results starting in cell H2.

Enter this formula in H2 and copy down as needed:

=COUNTIF(B$2:F$350,ROWS(H$2:H2))

But, how will you know what that result is for? The first few will be
obvious:

5
7
6
10
12

Why don't you identify the category like this:

1...5
2...7
3...6
4...10
5...12

This is easy to do.

Let's put the category in column H and the counts in column I.

Enter this formula in H2:

=ROWS(H$2:H2)

Enter this formula in I2:

=COUNTIF(B$2:F$350,H2)

Select both H2 and I2 and drag copy down as needed.

--
Biff
Microsoft Excel MVP


"b4nature" wrote in message
...
How do I get a formula to automatically update to count the number of
times a
changing value exists within the same range of cells?

Example:
If my range needs to always be B2:F350, how can I count within that range
how many times the number 1 appears, then 2, then 3, etc.

I have COUNTIF($B$2:$F$350,"=1") but I don't want to have to change the
number every time. I want to copy down so the 1 automatically changes to 2
then 3...

Thanks!





All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com