Lookup formula that omits duplicates

Drew_

Board Regular
Joined
Jul 8, 2017
Messages
87
Hi all.

I have a large data set where I am trying to determine which people worked on specific days. However, there are some instances where multiple people worked on the same day, so I am getting a double count; I only want to count it once. I have 1000 rows of data and I've provided some example data:

[TABLE="width: 365"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]John[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/13/2017 [/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/13/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/14/2017[/TD]
[TD] 1[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 365"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Paul[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/11/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/13/2017[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/13/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/13/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]September[/TD]
[TD][/TD]
[TD]9/15/2017[/TD]
[TD] 1[/TD]
[/TR]
</tbody>[/TABLE]


As you can see, a 1 appears each time a person starts a new workday; however, John and Paul both worked on the 13th so my formula is producing a 1 in both cells. I only want a 1 to appear the first time the new date appears (so for Paul on the 13th it would be a blank like the others).

To produce the 1, my formula is very simple:[TABLE="width: 59"]
<tbody>[TR]
[TD="class: xl65, width: 59"][TABLE="width: 59"]
<tbody>[TR]
[TD="class: xl65, width: 59"]
=IF(D473=D472,"",1)

where D has the dates


[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
I am thinking I need some sort of combination of ROW and OFFSET. Anyone have any ideas? Please let me know if I was not clear enough, thanks for any help
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Assuming your data is in A1:C8, you could put this in D1 and copy down.

Code:
=IF(COUNTIF($D$1:D1,D1)=1,1,"")

Otherwise, if you are just looking for a count of total unique dates, then you could use this formula.

Code:
=SUMPRODUCT(1/COUNTIF(D1:D8,D1:D8))

Adjust the ranges to fit your actual data.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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