Count unique text values in excel range with blank cells

nostradamus

Board Regular
Joined
Aug 9, 2010
Messages
143
Office Version
  1. 365
Platform
  1. Windows
Hello, I have used this formula for counting unique text values, but would like to set the formula for a spreadsheet where I can copy and paste data to get the unique occurances.
But the problem I found is that I have to set the range manually each time for this formula to work properly.
For instance, here the cell range to be counted is from A2 to A26

Excel Formula:
=SUMPRODUCT(--(FREQUENCY(MATCH(A2:A26,A2:A26,0),ROW(A2:A26)-ROW(A2)+1)>0))

I would like to set the range from cells A2 to A1000, when the actual data could only be for 100 cells or 500 cells depending on the dataset I use.
So, when I set the data range in the formula upto A1000, "N/A" is my result.

Excel Formula:
=SUMPRODUCT(--(FREQUENCY(MATCH(A2:A1000,A2:A1000,0),ROW(A2:A22000)-ROW(A2)+1)>0))
Thanks in advance
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,215,819
Messages
6,127,049
Members
449,356
Latest member
tstapleton67

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top