Remove duplicated pairs of data when counting time between dates

rainie

New Member
Joined
Jul 21, 2017
Messages
1
Hi all,

I need to count the total time spent for one task among various people, by counting the starting time and ending time of the sub-events.
Example here:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Event[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]Time[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]S[/TD]
[TD]E[/TD]
[TD]S[/TD]
[TD]E[/TD]
[TD]S[/TD]
[TD]E[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]1 Jan[/TD]
[TD]2 Feb [/TD]
[TD]3 Mar[/TD]
[TD]4 Apr[/TD]
[TD]5 May[/TD]
[TD]6 Jun[/TD]
[TD]W days[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]2 Jan[/TD]
[TD]2 Feb[/TD]
[TD]2 Jan [/TD]
[TD]2 Feb [/TD]
[TD]2 Jan[/TD]
[TD]3 Mar[/TD]
[TD]X days [/TD]
[/TR]
[TR]
[TD]Charles[/TD]
[TD]5 May [/TD]
[TD]6 Jun[/TD]
[TD]7 Jul[/TD]
[TD]8 Aug[/TD]
[TD]9 Sep[/TD]
[TD]10 Oct[/TD]
[TD]Y days [/TD]
[/TR]
[TR]
[TD]Danny[/TD]
[TD]2 Feb[/TD]
[TD]2 Feb[/TD]
[TD]3 Mar[/TD]
[TD]3 Mar[/TD]
[TD]4 Apr[/TD]
[TD]4 Apr[/TD]
[TD]Z days [/TD]
[/TR]
</tbody>[/TABLE]

**"S" represents starting time and "E" represents ending time.
"Time" represents time required for the whole task ( Event 1's E- Event 1's S + Event 2's E - Event's S+...)

However, sometimes, 2 different events can be completed in the same period, i.e. with same starting time and same ending time. We treat this as "duplicated pairs of data".

(Refer to "Brian's case, he completed both event 1 and 2 in the same period. )

Only two sets of starting date and ending dates are identical would be considered as "duplicated". If it has same starting date but different ending date, it is not being considered as "duplicated pairs of data", and vice versa.

I tried to use the Excel function (Data-->Remove Duplicates), but it checks basis on each cell but not a pair of data.

Using "Brian"'s case as example again, if I the "Remove Duplicates" function, the starting date in Event 3 will be removed as well, but I only want to remove Event 2, the identical pair of data.

I tried to create a new column for group data in S and data in E to make a new distinguishable code. ( by =S1+E1, and change it as "General' format)

[TABLE="width: 500"]
<tbody>[TR]
[TD]Event[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]Group[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]Group [/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]Group [/TD]
[TD]Time[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]S[/TD]
[TD]E[/TD]
[TD][/TD]
[TD]S[/TD]
[TD]E[/TD]
[TD][/TD]
[TD]S[/TD]
[TD]E[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]1 Jan[/TD]
[TD]2 Feb [/TD]
[TD]85504[/TD]
[TD]3 Mar[/TD]
[TD]4 Apr[/TD]
[TD]85626[/TD]
[TD]5 May[/TD]
[TD]6 Jun[/TD]
[TD]85752[/TD]
[TD]W days[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]2 Jan[/TD]
[TD]2 Feb[/TD]
[TD]85505[/TD]
[TD]2 Jan [/TD]
[TD]2 Feb [/TD]
[TD]85505[/TD]
[TD]2 Jan[/TD]
[TD]3 Mar[/TD]
[TD]85534[/TD]
[TD]X days [/TD]
[/TR]
[TR]
[TD]Charles[/TD]
[TD]5 May [/TD]
[TD]6 Jun[/TD]
[TD]85752[/TD]
[TD]7 Jul[/TD]
[TD]8 Aug[/TD]
[TD]85878[/TD]
[TD]9 Sep[/TD]
[TD]10 Oct[/TD]
[TD]86005[/TD]
[TD]Y days [/TD]
[/TR]
[TR]
[TD]Danny[/TD]
[TD]2 Feb[/TD]
[TD]2 Feb[/TD]
[TD]85536[/TD]
[TD]3 Mar[/TD]
[TD]3 Mar[/TD]
[TD]85594[/TD]
[TD]4 Apr[/TD]
[TD]4 Apr[/TD]
[TD]85658[/TD]
[TD]Z days [/TD]
[/TR]
</tbody>[/TABLE]

Although this helps me to identify/ delete the duplicated data in "Group column", I still need to delete the corresponding pair of duplicated data manually, for my future counting of time.

I have a thousands of fields to check and this is not efficient to check one by one. I wanna know what can I do, to fulfill all of the below:
1) find out the duplicated PAIR of data and
2) delete the duplicated PAIR of data and
3) The deletion of duplicated PAIR of data is based on individual person, but not for whole sheet.

( For example, Alex's event 3 starting and ending date is same as Charles's event 1 one, but this should not be deleted).

Thank you!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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