countif with partial name match

uceaamh

New Member
Joined
Feb 23, 2017
Messages
27
Hello,

I am attempting to create a list of employees who finished reports on time. My issue is that my data sources have different interpretations of their name.

I'll give an example.

In Sheet 1:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]% Reports Completed on Time[/TD]
[/TR]
[TR]
[TD]Hubert Humphrey[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mary Shelley[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Fats Domino[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

In Sheet 2:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]Report completed on time?[/TD]
[/TR]
[TR]
[TD]Humphrey[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]Shelley[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Humphrey[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Domino[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]Shelley[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]Domino[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Domino[/TD]
[TD]Yes[/TD]
[/TR]
</tbody>[/TABLE]


My current formula looks like:
Code:
=IF("*"&Sheet2[Employee]&"*"=Sheet1!A2,COUNTIF(Sheet2[Report completed on time?],"yes")/SUM(COUNTIF(Sheet2[Report completed on time?],"yes"),COUNTIF(Sheet2[Report completed on time?],"no")),"")

Which is not returning anything.

I know the issue lies in the partial name match.

Any suggestions?

Thanks!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
As an addendum:

In Sheet1, the list of Employees is generated using the following formula:

=IFERROR(INDEX(Table4[Employee], MATCH(0,IF($B$2=Table4[Place], IF($B$3=Table4[Team], COUNTIF($A$6:A6,Table4[Employee]),""),""),0)),"")

Where B2 and B3 are dropdown lists.

Not sure if that effects follow on formulas, but thought I should add that info.
 
Upvote 0
I'm trying to get a percentage.

Code:
[COLOR=#333333]=COUNTIF(Sheet2[Report completed on time?],"yes")/SUM(COUNTIF(Sheet2[Report completed on time?],"yes"),COUNTIF(Sheet2[Report completed on time?],"no"))[/COLOR]

successfully returns a % of "Yes" responses in the entire Sheet2[Report Completed on Time?] column.

So I'm attempting to add a criteria to that, limiting the numerator to "Yes" for a person, and the denominator to "Yes"+"No" for the same person.

Thanks for responding @Aladin Akyurek
 
Upvote 0
I'm trying to get the values you want to see under "% Reports Completed on Time" for the data posted... Care to provide those values?
 
Last edited:
Upvote 0
In this example, the values I'm looking for would be:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]% Reports Completed on Time[/TD]
[/TR]
[TR]
[TD]Hubert Humphrey[/TD]
[TD].5[/TD]
[/TR]
[TR]
[TD]Mary Shelley[/TD]
[TD].5[/TD]
[/TR]
[TR]
[TD]Fats Domino[/TD]
[TD].66[/TD]
[/TR]
</tbody>[/TABLE]

For the 1 yes/ 1 no connected to Humphrey, 1 yes/ 1 no for Shelley, and 2 yes / 1 no for Domino.

I can't get the formula that I'm putting in that column to use name as a criteria however.

Thanks again
 
Upvote 0
In B2 of Sheet1 enter and copy down:

=SUMPRODUCT(COUNTIFS(A2,"*"&Sheet2!$A$2:$A$8&"*"),--(Sheet2!$B$2:$B$8="Yes"))/SUMPRODUCT(COUNTIFS(A2,"*"&Sheet2!$A$2:$A$8&"*"))

The range references, I trust, are obvious.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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