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:

JohnSeptember9/13/2017 1
JohnSeptember9/13/2017
JohnSeptember9/14/2017 1

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
PaulSeptember9/11/2017
PaulSeptember9/13/2017 1
PaulSeptember9/13/2017
PaulSeptember9/13/2017
PaulSeptember9/15/2017 1

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>


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:

=IF(D473=D472,"",1)

where D has the dates



<tbody>
</tbody>

<tbody>
</tbody>
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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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