#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default Count

Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. Can I count the companies
but not the duplicates - there are too many to do countif and I am using 2003
version of Excel. Is there a count non-duplicates function or something like
that?

Thanks
--
Kind regards

Ann Shaw
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Count

In my example the company range is B1:B6, adjust it to your data structu

=SUMPRODUCT(1/COUNTIF(B1:B6,B1:B6&""))

Regards,
Stefi

€žAnnie€ť ezt Ă*rta:

Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. Can I count the companies
but not the duplicates - there are too many to do countif and I am using 2003
version of Excel. Is there a count non-duplicates function or something like
that?

Thanks
--
Kind regards

Ann Shaw

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Count

Assuming your company names are in A1:A100, this array* formula will
count the unique names:

=SUM(IF(LEN(A1:A100),1/COUNTIF(A1:A100,A1:A100)))

Assumes a data range of A1 to A100 - adjust as necessary.

*An array formula needs to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual Enter. If you do this
correctly then Excel will wrap curly braces around that formula when
viewed in the formula bar - do not type these yourself. If you edit/
amend the formula you need to use CSE again.

Hope this helps.

Pete


On Jan 30, 1:09*pm, Annie wrote:
Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. *Can I count the companies
but not the duplicates - there are too many to do countif and I am using 2003
version of Excel. *Is there a count non-duplicates function or something like
that?

Thanks
--
Kind regards

Ann Shaw


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Count

Say the list is in column H:

=SUMPRODUCT((H1:H1500<"")/COUNTIF(H1:H1500,H1:H1500&""))

adjust the range to suit your needs.
--
Gary''s Student - gsnu200829


"Annie" wrote:

Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. Can I count the companies
but not the duplicates - there are too many to do countif and I am using 2003
version of Excel. Is there a count non-duplicates function or something like
that?

Thanks
--
Kind regards

Ann Shaw

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Count

Hi,

You can try this formula

SUMPRODUCT(1/COUNTIF(D4:D11,D4:D11)). Please adjust the range as per your
needs

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Annie" wrote in message
...
Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. Can I count the
companies
but not the duplicates - there are too many to do countif and I am using
2003
version of Excel. Is there a count non-duplicates function or something
like
that?

Thanks
--
Kind regards

Ann Shaw




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default Count

Excellent!

Thanks so much...
--
Kind regards

Ann Shaw


"Stefi" wrote:

In my example the company range is B1:B6, adjust it to your data structu

=SUMPRODUCT(1/COUNTIF(B1:B6,B1:B6&""))

Regards,
Stefi

€žAnnie€ť ezt Ă*rta:

Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. Can I count the companies
but not the duplicates - there are too many to do countif and I am using 2003
version of Excel. Is there a count non-duplicates function or something like
that?

Thanks
--
Kind regards

Ann Shaw

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Count

You are welcome! Thanks for the feedback!
Stefi

€žAnnie€ť ezt Ă*rta:

Excellent!

Thanks so much...
--
Kind regards

Ann Shaw


"Stefi" wrote:

In my example the company range is B1:B6, adjust it to your data structu

=SUMPRODUCT(1/COUNTIF(B1:B6,B1:B6&""))

Regards,
Stefi

€žAnnie€ť ezt Ă*rta:

Hi
I have a column with a list of company names and people working in those
companies - but there are duplicate company names. Can I count the companies
but not the duplicates - there are too many to do countif and I am using 2003
version of Excel. Is there a count non-duplicates function or something like
that?

Thanks
--
Kind regards

Ann Shaw

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Count


Please follow following steps
1.Right Click toolbarclick control box
2.From control box select a command button and draw it to your sheet
3.Double click the command button to open code window and paste
following codes
Private Sub CommandButton1_Click()
Dim row As Integer, col As Integer, cnt As Integer
row = 1
col = 1
cnt = 1

While Sheet1.Cells(row, col).Value < ""
cnt = chkRepeat(Sheet1.Cells(row, col).Value, row)

Sheet1.Cells(row, col + 1).Value = cnt
row = row + 1
Wend

End Sub

Private Function chkRepeat(str As String, i As Integer) As Integer
Dim tmp As Integer
tmp = 1

Dim row As Integer, col As Integer
row = 1
col = 1

While Sheet1.Cells(row, col).Value < ""
If i < row Then
If Sheet1.Cells(row, col).Value = str Then
tmp = tmp + 1
End If
End If
row = row + 1
Wend

chkRepeat = tmp
End Function

Now on clicking the button you get the number of counts listed in
column B

Have a nice time….

Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com




--
Chris Bode
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
Multiple Criteria, Count If, Sum Product to get count across range Jonathan Excel Worksheet Functions 5 January 9th 08 11:32 PM
Count Employee Work Time - Don't Double-count Overlapping Apts. J Excel Worksheet Functions 0 April 27th 07 05:52 AM
Excel 2000, count, sort a list & count totals? sunslight Excel Worksheet Functions 1 April 9th 07 05:46 PM
Count Intervals of 2 Consecutive Values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 6 November 29th 05 03:27 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM


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