#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Countif only once

I Have a worksheet which I am adding rows to as i get information in.

One of the columns is country, what I want to do is countif so i know the
number of times that a country appears. Basically I am using a simple countif
formula in the adjacent cell to that specific row but extending the range so
it automatically counts new data when it is entered. For example my data
currently ranges from C1:C11 but my range is C1:C111 so as to automatically
pick up new data as it is entered. There is also not a set range of countries
so a new country might appear in C34 lets say.

What I need to avoid is the countif function repeating, so for example if
"Greece" appears in C4 and C8 then My countif formula in D4 will return 2 for
Greece... perfect, however the formula will once again return 2 in C8, I want
to avoid this so as the countif function is used once per country.

I hope this is clear, I'm in abit of a rush today.

Many thanks in adance for your help,

Kind regards,

Ant

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Countif only once

Are you using =COUNTIF($C$1:$C$111, "Greece")

If the formula is in D4, why would it return 2 in C8 if C8 contains "Greece".


"Anto111" wrote:

I Have a worksheet which I am adding rows to as i get information in.

One of the columns is country, what I want to do is countif so i know the
number of times that a country appears. Basically I am using a simple countif
formula in the adjacent cell to that specific row but extending the range so
it automatically counts new data when it is entered. For example my data
currently ranges from C1:C11 but my range is C1:C111 so as to automatically
pick up new data as it is entered. There is also not a set range of countries
so a new country might appear in C34 lets say.

What I need to avoid is the countif function repeating, so for example if
"Greece" appears in C4 and C8 then My countif formula in D4 will return 2 for
Greece... perfect, however the formula will once again return 2 in C8, I want
to avoid this so as the countif function is used once per country.

I hope this is clear, I'm in abit of a rush today.

Many thanks in adance for your help,

Kind regards,

Ant

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Countif only once

Hi Ant,

Put this in D1 and drag down,

=IF(COUNTIF(C$1:C1,C1)1,"",COUNTIF(C$1:C$111,C1))

That should put each countries count at the first occurrence of
each country.

HTH
Martin


"Anto111" wrote in message
...
I Have a worksheet which I am adding rows to as i get information in.

One of the columns is country, what I want to do is countif so i know the
number of times that a country appears. Basically I am using a simple
countif
formula in the adjacent cell to that specific row but extending the range
so
it automatically counts new data when it is entered. For example my data
currently ranges from C1:C11 but my range is C1:C111 so as to
automatically
pick up new data as it is entered. There is also not a set range of
countries
so a new country might appear in C34 lets say.

What I need to avoid is the countif function repeating, so for example if
"Greece" appears in C4 and C8 then My countif formula in D4 will return 2
for
Greece... perfect, however the formula will once again return 2 in C8, I
want
to avoid this so as the countif function is used once per country.

I hope this is clear, I'm in abit of a rush today.

Many thanks in adance for your help,

Kind regards,

Ant



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Countif only once

Count the occurrences, but then hide the results if it's more than 1.

=IF(COUNTIF($C$1:C1,C1)=1,COUNTIF(C:C,C1),"")
and drag down


Anto111 wrote:

I Have a worksheet which I am adding rows to as i get information in.

One of the columns is country, what I want to do is countif so i know the
number of times that a country appears. Basically I am using a simple countif
formula in the adjacent cell to that specific row but extending the range so
it automatically counts new data when it is entered. For example my data
currently ranges from C1:C11 but my range is C1:C111 so as to automatically
pick up new data as it is entered. There is also not a set range of countries
so a new country might appear in C34 lets say.

What I need to avoid is the countif function repeating, so for example if
"Greece" appears in C4 and C8 then My countif formula in D4 will return 2 for
Greece... perfect, however the formula will once again return 2 in C8, I want
to avoid this so as the countif function is used once per country.

I hope this is clear, I'm in abit of a rush today.

Many thanks in adance for your help,

Kind regards,

Ant


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Countif only once

Also,

If there is likely to be any blanks then you may want to use this
=IF(C1="","",IF(COUNTIF(C$1:C1,C1)1,"",COUNTIF($C $1:$C$111,C1)))

otherwise you will get a zero next to the blank cells.

HTH
Martin


"MartinW" wrote in message
...
Hi Ant,

Put this in D1 and drag down,

=IF(COUNTIF(C$1:C1,C1)1,"",COUNTIF(C$1:C$111,C1))

That should put each countries count at the first occurrence of
each country.

HTH
Martin


"Anto111" wrote in message
...
I Have a worksheet which I am adding rows to as i get information in.

One of the columns is country, what I want to do is countif so i know the
number of times that a country appears. Basically I am using a simple
countif
formula in the adjacent cell to that specific row but extending the range
so
it automatically counts new data when it is entered. For example my data
currently ranges from C1:C11 but my range is C1:C111 so as to
automatically
pick up new data as it is entered. There is also not a set range of
countries
so a new country might appear in C34 lets say.

What I need to avoid is the countif function repeating, so for example if
"Greece" appears in C4 and C8 then My countif formula in D4 will return 2
for
Greece... perfect, however the formula will once again return 2 in C8, I
want
to avoid this so as the countif function is used once per country.

I hope this is clear, I'm in abit of a rush today.

Many thanks in adance for your help,

Kind regards,

Ant





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
Countif Help Curtis Excel Worksheet Functions 8 December 5th 07 07:58 AM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 08:40 PM.

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"