ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Countif questions (https://www.excelbanter.com/excel-discussion-misc-queries/145321-countif-questions.html)

GeorgeW

Countif questions
 
I have a problem with the countif function

Here's a simple example of what I'm trying to do
here's my sheet, columns A and B
A B C
1 2
2 2
3 2
4 3
5 3
6 3
7 4
8 4
9 4

In Cell C1, when I put in function =countif($A$1:$A$9, "2")
this returns 7, which is what I want.

But I want to put =countif($A$1:$A$9, "B1") and so on for each row in
column B. It doesn't work. I tried =countif($A$1:$A$9, B1) too, and it gave
me an syntax error.

Is there a way I can accomplish what I want?

Any help would be greatly appreciated!
Thanks!


RagDyeR

Countif questions
 
To use a cell as a reference, use this:

=Countif(A1:A9,""&B1)
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"GeorgeW" wrote in message
...
I have a problem with the countif function

Here's a simple example of what I'm trying to do
here's my sheet, columns A and B
A B C
1 2
2 2
3 2
4 3
5 3
6 3
7 4
8 4
9 4

In Cell C1, when I put in function =countif($A$1:$A$9, "2")
this returns 7, which is what I want.

But I want to put =countif($A$1:$A$9, "B1") and so on for each row in
column B. It doesn't work. I tried =countif($A$1:$A$9, B1) too, and it
gave
me an syntax error.

Is there a way I can accomplish what I want?

Any help would be greatly appreciated!
Thanks!





Ron Coderre

Countif questions
 
If I understand you correctly, try this:

=COUNTIF($A$1:$A$9, ""&B1)

Does that help?
-------------------

Regards,

Ron
Microsoft MVP (Excel)


--------------------
"GeorgeW" wrote in message
...
I have a problem with the countif function

Here's a simple example of what I'm trying to do
here's my sheet, columns A and B
A B C
1 2
2 2
3 2
4 3
5 3
6 3
7 4
8 4
9 4

In Cell C1, when I put in function =countif($A$1:$A$9, "2")
this returns 7, which is what I want.

But I want to put =countif($A$1:$A$9, "B1") and so on for each row in
column B. It doesn't work. I tried =countif($A$1:$A$9, B1) too, and it
gave
me an syntax error.

Is there a way I can accomplish what I want?

Any help would be greatly appreciated!
Thanks!




Roger Govier

Countif questions
 
Hi George

try
=COUNTIF($A$1:$A$9,""&B1)

--
Regards

Roger Govier


"GeorgeW" wrote in message
...
I have a problem with the countif function

Here's a simple example of what I'm trying to do
here's my sheet, columns A and B
A B C
1 2
2 2
3 2
4 3
5 3
6 3
7 4
8 4
9 4

In Cell C1, when I put in function =countif($A$1:$A$9, "2")
this returns 7, which is what I want.

But I want to put =countif($A$1:$A$9, "B1") and so on for each row in
column B. It doesn't work. I tried =countif($A$1:$A$9, B1) too, and
it gave
me an syntax error.

Is there a way I can accomplish what I want?

Any help would be greatly appreciated!
Thanks!




MartinW

Countif questions
 
Hi George,

Try it like this =countif($A$1:$A$9, ""&B1)

HTH
Martin


"GeorgeW" wrote in message
...
I have a problem with the countif function

Here's a simple example of what I'm trying to do
here's my sheet, columns A and B
A B C
1 2
2 2
3 2
4 3
5 3
6 3
7 4
8 4
9 4

In Cell C1, when I put in function =countif($A$1:$A$9, "2")
this returns 7, which is what I want.

But I want to put =countif($A$1:$A$9, "B1") and so on for each row in
column B. It doesn't work. I tried =countif($A$1:$A$9, B1) too, and it
gave
me an syntax error.

Is there a way I can accomplish what I want?

Any help would be greatly appreciated!
Thanks!





All times are GMT +1. The time now is 10:34 PM.

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