Count distinct (remove duplicate) strings that contains a specific text in an Excel column

wongced

New Member
Joined
Mar 21, 2018
Messages
3
Hi,

I have a long list of texts that I need to count how many are distinct (the first occurrence), but only with only contains the word "LOOP" in the text, all the text are in 1 column. I know I can do this with remove duplicates, but I will constantly update the list, so I hope there is a way to automatically update the value.

sample of my texts:
[TABLE="width: 64"]
<colgroup><col width="64" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]RING1_LOOP6[/TD]
[/TR]
[TR]
[TD]RING6_LOOP4[/TD]
[/TR]
[TR]
[TD]RING5_LOOP30[/TD]
[/TR]
[TR]
[TD]RING5[/TD]
[/TR]
[TR]
[TD]RING7_LOOP40[/TD]
[/TR]
[TR]
[TD]RING1_LOOP6[/TD]
[/TR]
[TR]
[TD]RING5_LOOP30[/TD]
[/TR]
</tbody>[/TABLE]

so in above texts, the RING5 should not be counted, so the return value should be 4.
because, RING1_LOOP6, RING6_LOOP4, RING5_LOOP30, and RING7_LOOP40 only.


It will be very helpful if anyone can help me on this.
Thank you!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
DATA in A2:A8

ARRAY Formula

=SUM(IFERROR(1/(COUNTIF($A$2:$A$8,IF(ISNUMBER(FIND("LOOP",$A$2:$A$8)),$A$2:$A$8,"ZZZZZZ"))),0))

ARRAY formula is used


To enter ARRAY formula
Paste the formula
Press F2
Press Ctrl+Shift+Enter keys together.
formula will be covered with{} brackets by excel.
 
Upvote 0
1] Assume your data put in A2:A8

2] B2, enter formula :

=SUMPRODUCT(ISNUMBER(SEARCH("LOOP",A2:A8))/COUNTIF(A2:A8,A2:A8))

Regards
Bosco
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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