Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jkl jkl is offline
external usenet poster
 
Posts: 17
Default Counting records f(x) two columns

I'm looking for the right formula. I have two columns of data. Column A
lists countries where activities are taking place, column B categorizes the
country as one of five types. How can I total the number of different
countries that fall under each category of country?

For example, Australia might appear 6 times in Column A but it should not
count as six instances of the country type associated with it. If should
only count as one instance of that country type. Assuming for a moment that
Oman is given the same country category as Australia, it should also count as
one instance of that country type, regardless of how many times Oman appears
in Column A.

TIA . . .


  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Counting records f(x) two columns

If countries are in A1:A7 and type is in B1:B7

=SUMPRODUCT(--(MATCH(A1:A7,A1:A7,0)=ROW(A1:A7)-ROW(A1)+1),--(B1:B7=1))

Where I am looking for type 1. Change ranges and type as needed (type could
be a reference to a cell that has the type you are looking for).


"jkl" wrote:

I'm looking for the right formula. I have two columns of data. Column A
lists countries where activities are taking place, column B categorizes the
country as one of five types. How can I total the number of different
countries that fall under each category of country?

For example, Australia might appear 6 times in Column A but it should not
count as six instances of the country type associated with it. If should
only count as one instance of that country type. Assuming for a moment that
Oman is given the same country category as Australia, it should also count as
one instance of that country type, regardless of how many times Oman appears
in Column A.

TIA . . .


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 860
Default Counting records f(x) two columns

Hi JKL,

This may help you (or not).<g
Select your data in Col. A and goto DataFilterAdvanced Filter,
Check 'Copy to another Location'
Check 'Unique Records Only'
Select a destination cell in the Copy to box
And OK out.

HTH
Martin


  #4   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Counting records f(x) two columns

Of course, I assumed that every instance of "Australia" would be the same
type. If it is possible "Australia" could appear as several different types,
then try:

=SUMPRODUCT(--(MATCH(A1:A7&B1:B7,A1:A7&B1:B7,0)=ROW(A1:A7)-ROW(A1)+1),--(B1:B7=D8))

where D8 is the type you are looking for.


"JMB" wrote:

If countries are in A1:A7 and type is in B1:B7

=SUMPRODUCT(--(MATCH(A1:A7,A1:A7,0)=ROW(A1:A7)-ROW(A1)+1),--(B1:B7=1))

Where I am looking for type 1. Change ranges and type as needed (type could
be a reference to a cell that has the type you are looking for).


"jkl" wrote:

I'm looking for the right formula. I have two columns of data. Column A
lists countries where activities are taking place, column B categorizes the
country as one of five types. How can I total the number of different
countries that fall under each category of country?

For example, Australia might appear 6 times in Column A but it should not
count as six instances of the country type associated with it. If should
only count as one instance of that country type. Assuming for a moment that
Oman is given the same country category as Australia, it should also count as
one instance of that country type, regardless of how many times Oman appears
in Column A.

TIA . . .


  #5   Report Post  
Posted to microsoft.public.excel.misc
jkl jkl is offline
external usenet poster
 
Posts: 17
Default Counting records f(x) two columns

Worked great! Thanks!

"JMB" wrote:

If countries are in A1:A7 and type is in B1:B7

=SUMPRODUCT(--(MATCH(A1:A7,A1:A7,0)=ROW(A1:A7)-ROW(A1)+1),--(B1:B7=1))

Where I am looking for type 1. Change ranges and type as needed (type could
be a reference to a cell that has the type you are looking for).


"jkl" wrote:

I'm looking for the right formula. I have two columns of data. Column A
lists countries where activities are taking place, column B categorizes the
country as one of five types. How can I total the number of different
countries that fall under each category of country?

For example, Australia might appear 6 times in Column A but it should not
count as six instances of the country type associated with it. If should
only count as one instance of that country type. Assuming for a moment that
Oman is given the same country category as Australia, it should also count as
one instance of that country type, regardless of how many times Oman appears
in Column A.

TIA . . .




  #6   Report Post  
Posted to microsoft.public.excel.misc
jkl jkl is offline
external usenet poster
 
Posts: 17
Default Counting records f(x) two columns

Also worked great! Thanks.

"JMB" wrote:

Of course, I assumed that every instance of "Australia" would be the same
type. If it is possible "Australia" could appear as several different types,
then try:

=SUMPRODUCT(--(MATCH(A1:A7&B1:B7,A1:A7&B1:B7,0)=ROW(A1:A7)-ROW(A1)+1),--(B1:B7=D8))

where D8 is the type you are looking for.


"JMB" wrote:

If countries are in A1:A7 and type is in B1:B7

=SUMPRODUCT(--(MATCH(A1:A7,A1:A7,0)=ROW(A1:A7)-ROW(A1)+1),--(B1:B7=1))

Where I am looking for type 1. Change ranges and type as needed (type could
be a reference to a cell that has the type you are looking for).


"jkl" wrote:

I'm looking for the right formula. I have two columns of data. Column A
lists countries where activities are taking place, column B categorizes the
country as one of five types. How can I total the number of different
countries that fall under each category of country?

For example, Australia might appear 6 times in Column A but it should not
count as six instances of the country type associated with it. If should
only count as one instance of that country type. Assuming for a moment that
Oman is given the same country category as Australia, it should also count as
one instance of that country type, regardless of how many times Oman appears
in Column A.

TIA . . .


  #7   Report Post  
Posted to microsoft.public.excel.misc
jkl jkl is offline
external usenet poster
 
Posts: 17
Default Counting records f(x) two columns

Very helpful; I used the JMB approach, but this technique will be useful for
other things I'm doing with this sheet. Thanks.

"MartinW" wrote:

Hi JKL,

This may help you (or not).<g
Select your data in Col. A and goto DataFilterAdvanced Filter,
Check 'Copy to another Location'
Check 'Unique Records Only'
Select a destination cell in the Copy to box
And OK out.

HTH
Martin



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
Help a novice with counting number of records TheBoz Excel Discussion (Misc queries) 3 November 14th 06 04:20 AM
counting records [email protected] Excel Worksheet Functions 8 September 14th 06 09:38 PM
Counting unique records yhtak Excel Worksheet Functions 6 June 16th 06 02:34 PM
Counting records within a month JoAnn New Users to Excel 1 November 22nd 05 06:15 PM
Counting datapoints/records in time interval [email protected] Charts and Charting in Excel 1 April 15th 05 05:46 AM


All times are GMT +1. The time now is 02:06 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"