COUNT duplicate text strings within a single cell AND a whole column, returning the SUM of all

mynerva

New Member
Joined
Jul 12, 2016
Messages
2
Hello
I have come across a couple solutions in this forum which seem to each address two halves of my desire, but I cannot get them to work together!

I have a series of tasks. Each day, 1 or more tasks is completed, and often a task is completed multiple times on the same date. Column B the result of a data validation drop down list, which allows for multiple and duplicate selection, entering the selections into the same cell, separated by commas.

For example:

AB
1July 10Task A, Task A, Task B
2July 11Task, B, Task B, Task C
3July 12 Task A, Task B, Task C
4July 13 Task C, Task C, Task C

<tbody>
</tbody>

I am trying to set something up that will now count how many times any given task was completed, both in a single date AND for the whole year.

The resulting count for the above should be:

AB
1Task A3
2Task B4
3Task C5

<tbody>
</tbody>

I have tried using LEN and COUNTIF formulas (that I found in the forums) for B1:B3 directly above, but in either cases - using Row 1 as an example -

COUNTIF will count the total Task A's in the range of B1:B4, but it excludes duplicates in the same cell/row - so the total count comes out to 2 (instead of 3). Also, I found that I had to use *wildcards around the text string, or else it would not find the text string!
=COUNTIF($B$1:$B$4,"=*Task A*")


LEN will count the total of Task A's in the cell B1, but if I change the cell to be searched from B1 to a range (B1:B4), it reverts to only counting 1 instance of Task A per cell
=(LEN(B1)-LEN(SUBSTITUTE(B1, A1, "")))/LEN(A1)

I'm not sure what I'm doing wrong, or if maybe there is a better way to accomplish this ....
Hopefully some can help! I'm using Excel 2013 right now, in case that makes a difference.
Thanks!
Mynerva
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Here's how I see doing it.


Unknown
ABCDE
1Task ATask BTask C
27/10/2016Task A, Task A, Task B210
37/11/2016Task B, Task B, Task C021
47/12/2016Task A, Task B, Task C111
57/13/2016Task C, Task C, Task C003
6
7345
Sheet2
Cell Formulas
RangeFormula
C2=(LEN($B2)-(LEN(SUBSTITUTE($B2,C$1,""))))/LEN(C$1)
C7=SUM(C2:C5)
D2=(LEN($B2)-(LEN(SUBSTITUTE($B2,D$1,""))))/LEN(D$1)
D7=SUM(D2:D5)
E2=(LEN($B2)-(LEN(SUBSTITUTE($B2,E$1,""))))/LEN(E$1)
E7=SUM(E2:E5)
 
Last edited:
Upvote 0
Thanks Jonmo1! It is a bit unwieldy once I put in the 21 actual tasks and task names (which are many more characters long), and a year's worth of dates - but it gets the job done!
Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,375
Members
449,155
Latest member
ravioli44

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