Removing Duplicate Timings Formula/VBA

GarethT

New Member
Joined
Jan 24, 2013
Messages
7
Hi All,

I have a small issues. My guys record downtime at a station, but because their stations are so far apart sometimes they duplicate this time. I was wondering how I could remove the duplicate timings. My report is as follows;
A B C D E
Date Time Date Time
21/04/201414:35 21/04/201414:4510
21/04/201415:50 21/04/201416:2333
21/04/201416:00 21/04/201422:00360
21/04/201416:30 21/04/201416:4010
21/04/201416:55 21/04/201417:1015
21/04/201417:00 21/04/201417:1515
21/04/201418:04 21/04/201418:106
21/04/201418:30 21/04/201419:0030
21/04/201419:38 21/04/201419:5113
21/04/201420:05 21/04/201420:105
21/04/201420:28 21/04/201420:324
21/04/201421:00 21/04/201421:2020
21/04/201421:32 21/04/201421:364
21/04/201422:37 21/04/201423:3760
21/04/201423:45 21/04/201423:505
21/04/201423:55 22/04/201400:0510
22/04/201400:15 22/04/201400:2510

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

I so far have come up with

=IF(C2=C3,(IF(OR(I3="REASON CODE",I3=0),"0",IF(D2>B3,(E2+E3)-E2,"0"))),0)

But it comes up with minus figures for the 2nd row and will only subtract 10 minutes from the 3rd row

Really stuck on this one, any help appreciated

Gareth
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I don't see any duplicate timings in your table.

What is it you wnat to do, to remove (a row with ) duplicate times or to change the time in that row.
Perhaps you can illustrate with a table before and after.
 
Upvote 0
I would like to change the time in that row. I mean that the timings are counted twice in rows 2 and 3.
 
Upvote 0
I think this is what you are after. The corrected duration column can replace your column E

Excel 2010
ABCDEFGHI
3DateTimeDate2Time2DurationCorrectedDuration
421/04/201414:3521/04/201414:4500:10:0000:10:001
521/04/201415:5021/04/201416:2300:33:0000:10:001
621/04/201416:0021/04/201422:0006:00:0000:30:001
721/04/201416:3021/04/201416:4000:10:0000:10:001
821/04/201416:5521/04/201417:1000:15:0000:05:001
921/04/201417:0021/04/201417:1500:15:0000:15:001
1021/04/201418:0421/04/201418:1000:06:0000:06:001
1121/04/201418:3021/04/201419:0000:30:0000:30:001

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Timings

Worksheet Formulas
CellFormula
E4=(C4+D4)-(A4+B4)
G4=IF(OR(I4="REASON CODE",I4=0),"0",IF((C4+D4)>(A5+B5),(A5+B5)-(A4+B4),(C4+D4)-(A4+B4)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


The formula includes the date, so you don't need to check if the dates are different
 
Upvote 0

Forum statistics

Threads
1,216,069
Messages
6,128,598
Members
449,460
Latest member
jgharbawi

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