Counting first instance of recurring value against unique text in another column

sarithakola

New Member
Joined
May 20, 2014
Messages
4
Hi, here is a sample data set the result I want from the formula is in the last column Overallocated Employee;

<tbody>
[TD="class: xl63, align: right"][/TD]

</tbody>
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Employee[/TD]
[TD]COUNTIFS(B:B,B2)[/TD]
[TD]Overallocated Employee(more than 1 ID assigned.)[/TD]
[/TR]
[TR]
[TD]XMP001[/TD]
[TD]Jim[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]XMP002[/TD]
[TD]Mary[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]XMP003[/TD]
[TD]Steve[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]XMP004[/TD]
[TD]Bob[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP005[/TD]
[TD][/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP006[/TD]
[TD]Helen[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP007[/TD]
[TD]Jim[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP008[/TD]
[TD]Mary[/TD]
[TD]3[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP009[/TD]
[TD][/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP010[/TD]
[TD]Dan[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP011[/TD]
[TD]Jacob[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP012[/TD]
[TD]Steve[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP013[/TD]
[TD]Amanda[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]XMP014[/TD]
[TD]Amanda[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XMP015[/TD]
[TD]Mary[/TD]
[TD]3[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

I want the value in Overallocated Employee column to be turned to 1 any overallocated employee (i.e. employees with more than 1 IDs assigned to them), for the first occurence of overallocation. I basically want to be able to get unique count of overallocation employees. I am using COUNTIFS in third column to see how many allocation each employee has, but it repeats.
Please help with the formula to get the last column above.

Thanks,
SK
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Yes. Thats correct. I manually created 4th column to show the output that I want to get.
Thanks

C2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF($B2="",0,IF(ISNUMBER(MATCH($B2,$B$1:B1,0)),0,
  IF(SUM(IF(FREQUENCY(IF($A$2:$A$16<>"",IF($B$2:$B$16=$B2,MATCH($A$2:$A$16,$A$2:$A$16,0))),
  ROW($A$2:$A$16)-ROW($A$2)+1),1))>1,1,0)))
 
Upvote 0
C2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF($B2="",0,IF(ISNUMBER(MATCH($B2,$B$1:B1,0)),0,
  IF(SUM(IF(FREQUENCY(IF($A$2:$A$16<>"",IF($B$2:$B$16=$B2,MATCH($A$2:$A$16,$A$2:$A$16,0))),
  ROW($A$2:$A$16)-ROW($A$2)+1),1))>1,1,0)))


Thanks Aladin. This works like magic :)
 
Upvote 0
Hi Dreadknight, this most definitely works, but like you said the blanks are a problem :) Thanks for the response, please see Aladin's code below that takes care of blanks as well.

SK
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

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