How to to count unique text in a column- and two specific text

wmichael

Board Regular
Joined
Aug 26, 2014
Messages
113
Office Version
  1. 365
  2. 2019
  3. 2007
Platform
  1. Windows
  2. Mobile
Hello.

I use this formula to count unique text in a column and it works well:
=ArrayFormula(SUM(IF(FREQUENCY(IF(LEN(L4:L)>0,MATCH(L4:L,L4:L,0),""), IF(LEN(L4:L)>0,MATCH(L4:L,L4:L,0),""))>0,1))) resulting in 6.

But the cells in the column also contain the word "Sea" or "Freedom" followed by a city name. For example "Sea Miami" or "Freedom Michigan" and I want to count the unique text for each Sea and Freedom city as a concatenate formula- For example column L has, there are 4 Sea and 3 Freedom.

Sea Miami
Sea Tampa
Sea Boston
Sea Miami
Sea Miami
Freedom Michigan
Freedom Tampa
Freedom New Jersey
Freedom Tampa

Appreciate your suggestions- thank you, Michael
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I can see only 3 unique, not 4, for "Sea"

Try this array formula
=SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH("Sea",L4:L100)),MATCH(L4:L100,L4:L100,0)),ROW(L4:L100)-ROW(L4)+1),1))
Ctrl+Shift+Enter

change "Sea" by "Freedom" to count unique values that contain Freedom

M.
 
Upvote 0
This works - might you know how to use as concatenate

I can see only 3 unique, not 4, for "Sea"

Try this array formula
=SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH("Sea",L4:L100)),MATCH(L4:L100,L4:L100,0)),ROW(L4:L100)-ROW(L4)+1),1)) + =SUM(IF(FREQUENCY(IF(ISNUMBER(SEARCH("Freedom",L4:L100)),MATCH(L4:L100,L4:L100,0)),ROW(L4:L100)-ROW(L4)+1),1))
Ctrl+Shift+Enter

change "Sea" by "Freedom" to count unique values that contain Freedom

M.

Thank you, Michael
 
Upvote 0
Thank you- I was seeking a single column solution. Thanks again, Michael
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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