Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting Unique Values subject to Condition, text strings--

Status
Not open for further replies.

TomYC

Technical User
Dec 11, 2008
191
US
I have been reading up on the counting unique values threads, learning about arrays, FREQUENCY, etc.
Here is a simple version of what I need to count:
ID Issues
1203 Rights
1203 Rights and Wrongs
1204 Rights
1205 Rights and Wrongs

This count should total three, i.e. I am looking for unique values containing the word "Rights" in this example.
My actual formula, so far, with several items changed (it's more complicated than my example, and I'm looking for instances of "Rights and Ethics" even if mixed in with other text strings), is the following:

=SUM(IF(FREQUENCY(IF(October!$D$2:$D$1000="Rights and Ethics",IF(October!$A$2:$A$1000<>"",MATCH(October!$A$2:$A$1000,October!$A$2:$A$1000,0))),ROW(October!$A$2:$A$1000)-ROW(October!$A$2)+1),1))

--This is entered as an array formula, and right now will miss records containing my desired text and also other text. So perhaps I just need a modification to my 2nd IF statement?
 
I am not able to follow your formula.

I believe if your data is in column B then

=(SUM(LEN(B2:B60))-SUM(LEN(SUBSTITUTE(B2:B60, $C$2, ""))))/LEN($C$2)

This finds the total number of times the string happens in column B. It looks for the string contained in C2.

If you are looking for right it will not find right in righteous


Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 
I am always in a rush. Today to get out of here. Don't forget to use it as an array formula.

Canadian eh! Check out the new social forum Tek-Tips in Canada.
With the state of the world today, monkeys should get grossly insulted when humans claim to be their decendents
 
I realize my current formula is complex!
But I need two separate conditions:
1)Need to count any occurrence of a particular text string;
but
2)only in records/rows without duplicates in another column as well, thus, my first two lines of data in the example count only once.

The actual formula I submitted will take care of the second condition I believe, but it misses records where the desired text string occurs amidst other text data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top