Tuesday, October 3, 2017

Count unique text values in excel range

Thanks to this site for giving me the solution to this challenge.
https://exceljet.net/formula/count-unique-text-values-in-a-range

Excerpt from the site:

Handling empty cells in the range

If any of the cells in the range are empty, and you want to use FREQUENCY instead of COUNTIF, you'll need use a more complicated array formula that includes IF:
{=SUM(IF(FREQUENCY(IF(data<>"", MATCH(data,data,0)),ROW(data)-ROW(data.firstcell)+1),1))}
Note: because the logical test portion of the IF statement contains an array, the formula becomes an array formula that requires Control-Shift-Enter. This is why SUMPRODUCT has been replaced with SUM.

No comments: