Find my missing time

gkbrenne

New Member
Joined
Jan 30, 2009
Messages
5
I am hoping someone can help me out. I am using a program to track my time used on projects (Toggl), but I have found that I have some missing time blocks. Instead of finding the time blocks manually, I'd like to use Excel to do this.

The spreadsheet from Toggl looks like this
DescriptionBillableStart dateStart timeEnd dateEnd timeDuration
PM: NodalNo8/18/20177:10:158/18/20177:31:520:21:37
Quickbooks/Process reviewNo8/18/20177:31:538/18/201711:54:564:23:02
First draft-requirementsNo8/18/201712:30:328/18/201713:16:450:46:13
Lv1 Phone SupportNo8/18/201713:57:488/18/201714:27:480:30:00
CRM CleanupNo8/18/201714:41:498/18/201717:14:422:32:53

<tbody>
</tbody>

Can anyone think of a way that I can find a gap in my time entries using VBA or formulas? My ideal results from above would be:
8/18/2017 11:55:57 8/18/17 12:30:31 0:34:34
8/18/2017 13:16:46 8/18/17 13:57:47 0:41:01

I don't have to be that accurate, but you get the idea.

Any help would be appreciated!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
ERewk7x.png


I8 : =IF($F9+TIME(0,0,1)=$D10,"", $F9+TIME(0,0,1))
J8 : =IF($F9+TIME(0,0,1)=$D10,"", $D10-TIME(0,0,1))

And you drag them down. They leave cell empty if there's no break, and they fill them if there is. Cheers
 
Upvote 0
If we assume the data you posted covers A1 :G6 some VBA like this might work to fill in the gaps

Code:
Sub findTime()
On Error GoTo xit:
Application.ScreenUpdating = False
Application.Calculation = xlCalculateManual
Dim FinalRow As Integer
Dim startTime As Date
Dim endTime As Date


  FinalRow = Cells(Rows.Count, "C").End(xlUp).Row




    For i = FinalRow To 3 Step -1
    startTime = TimeValue(Range("F" & i - 1).Text) + TimeValue("00:00:01")
    endTime = TimeValue(Range("D" & i).Text) - TimeValue("00:00:01")
    If startTime - endTime < 0 Then


    Range("A" & i & ":G" & i).Insert (xlShiftDown)
    Range("C" & i & ",E" & i).Value = Range("C" & i + 1).Value
    Range("A" & i).Value = "MISSING TIME"
    Range("D" & i).Value = startTime
    Range("F" & i).Value = endTime
    Range("G" & i).Value = endTime - startTime
    End If
    Next i
  
xit:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
 
Upvote 0
Thank you piotrekp1 for getting me going! I made the mistake of including only one day of entries -- this will go on and on through the month. Also, I don't have to be exact to the second -- just the minute. But as with all good solutions, I was able to re-engineer it.

I8 now looks like: =TEXT($K8+TIME(0,0,1),"h:mm")
J8 : =TEXT($I9-TIME(0,0,1),"h:mm")

In K8 I have it calculate the gap and if it is less than 1 minute or are different days, I do not have it display anything.
k8 : =IF(E8=C9,IF(J8=I8,"",J8-I8),"")

ABCDEFGHIJK
DescriptionBillableStart dateStart timeEnd dateEnd timeDurationDateGapStartGapEndGapDuration
Meet kenNo8/1/20178:008/1/20178:300:30:008/1/20178:308:30
CrestonNo8/1/20178:308/1/201713:284:58:008/1/201713:2813:290:01
LunchNo8/1/201713:298/1/201713:290:00:008/1/201713:2918:104:41
Home & AwayNo8/1/201718:108/1/201718:100:00:00
AgWesternNo8/2/201711:008/2/201711:240:24:46 8/2/201711:2411:300:06

<tbody>
</tbody>

(For clarity sake, I removed the IF statement that checks if the date is different from the above formulas)

I now have a quick way to see what other time entries I need to make.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,492
Messages
6,125,115
Members
449,206
Latest member
burgsrus

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