#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default 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!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default 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!




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default 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!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default 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!



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 860
Default 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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 Questions John Calder New Users to Excel 18 August 24th 06 04:17 AM
Countif accross multiple questions. golden Excel Discussion (Misc queries) 1 October 28th 05 05:59 PM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
Questions??? Metalteck Excel Discussion (Misc queries) 2 May 24th 05 08:18 PM
2 questions Mark1 Excel Discussion (Misc queries) 2 March 15th 05 09:08 PM


All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"