Aug 24 2023 10:32 AM
Hi,
I'm a relative novice with Excel.
I have a column of hundreds of names - many of which are duplicated. Both the first name and surname are in the same cell in one long column.
Is there a function or combination of functions which could be entered into a cell below this list which would identify how many unique names there are in the whole column?
A simple number in the cell is all that's required.
thanks for help
Pete
PS - I'm using Excel for Mac
Aug 24 2023 10:45 AM
Aug 24 2023 12:49 PM - edited Aug 24 2023 12:50 PM
One of these perhaps.
List = your range
'Count after dupes are removed.
=COUNTA(UNIQUE(list))
'Count of names only appearing once in list.
=COUNTA(UNIQUE(list,,1))
Aug 25 2023 12:36 PM
Aug 25 2023 12:38 PM
Aug 25 2023 01:22 PM
That is odd. The danger with the formula is typically one of giving 'false positives' where trivial differences give rise to distinct names. To get 1 it is likely that the COUNTA is hiding a problem with FILTER. It would be worth seeing what you get from
= UNIQUE(list)
before performing the count. My best guess is that you are using an obsolete version of Excel that does not have the UNIQUE function.
Aug 26 2023 05:16 AM
Aug 26 2023 05:19 AM
Aug 26 2023 06:06 AM
SolutionDoes this formula work for you? It doesn't use functions that are only available in recent versions of Excel.
=SUMPRODUCT((C4:C641<>"")/COUNTIF(C4:C641,""&C4:C641))
or (confirmed by pressing Control+Shift+Return or Command+Return):
=SUM(IF(FREQUENCY(IF(C4:C641<>"",MATCH(C4:C641,C4:C641,0)),ROW(C4:C641)-ROW(C4)+1),1))
Aug 26 2023 06:10 AM
In general that could be
=ROWS( UNIQUE( TOCOL(C:C,3) ) )
if only it's in the same column C.
Aug 26 2023 08:34 AM
Aug 26 2023 08:38 AM
Aug 26 2023 08:42 AM
The formula already excludes blank cells from the count!
But if you have cells that only contain a space (or multiple spaces), those would be included.
Aug 26 2023 02:12 PM
I would go with @SergeiBaklan's formula because I can. The hard-wired range C:C could be replaced by a 2D range (or even 3D range across sheets) and it still works. It will ignore both blank cells and errors.
The catch is that Excel 2019 was already obsolete when it was first issued since dynamic arrays, which came out in 2018, didn't make the cut.
Aug 26 2023 06:06 AM
SolutionDoes this formula work for you? It doesn't use functions that are only available in recent versions of Excel.
=SUMPRODUCT((C4:C641<>"")/COUNTIF(C4:C641,""&C4:C641))
or (confirmed by pressing Control+Shift+Return or Command+Return):
=SUM(IF(FREQUENCY(IF(C4:C641<>"",MATCH(C4:C641,C4:C641,0)),ROW(C4:C641)-ROW(C4)+1),1))