Forum Discussion
Obtaining a count of items in a column
I loaded the dynamic array version of Excel and already I am dreading having to revert to deliver client workbooks. I made the list of companies into a table so that the named range 'list' (of companies) becomes dynamic. I then move to my formula cell and named it 'distinct'.
The formula I inserted into the cell is
= SORT(UNIQUE(list))
which spills to provide a list of the distinct company names from 'list', sorted alphabetically. Moving across again, I name a new formula cell 'occurrences' and then insert the formula
= COUNTIFS(list, distinct#)
to get a count corresponding to each distinct company.
The number of distinct companies 'countDistinct' is given by
= COUNTA(distinct#)
and, just as a check, the values
= COUNTA(list)
= SUM(occurrences#)
are identical.
So few formulas, so many results!