+ Reply to Thread
Results 1 to 3 of 3

Calculating time difference?

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    60

    Unhappy Calculating time difference?

    hi guys,
    I have a excel sheet with staff details(employee id and name) and their entry and exit timings.But the entry and the exit timings are in the same cell.And also sometimes the entry time is in AM and the exit in PM,sometimes the entry is in PM and the exit is in AM(the next day).I need to calculate the time difference between these 2 times.
    I made a sheet by splitting the time using right and left command in excel and converting that string into number and finding time difference.but this thing is not working for all the entry and exit times.
    Can anyone help me with a good solution.
    Please find the attached file for details.
    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,127

    Re: Calculating time difference?

    hi devpp, welcome to the forum. try:
    =MOD(MID(SUBSTITUTE(G5,"(1)",""),FIND(",",SUBSTITUTE(G5,"(1)",""))+1,11)-LEFT(G5,FIND("(",G5)-1),1)

    then format to the format you need like hh:mm

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    12-27-2012
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Calculating time difference?

    Quote Originally Posted by benishiryo View Post
    hi devpp, welcome to the forum. try:
    =MOD(MID(SUBSTITUTE(G5,"(1)",""),FIND(",",SUBSTITUTE(G5,"(1)",""))+1,11)-LEFT(G5,FIND("(",G5)-1),1)

    then format to the format you need like hh:mm
    Thank you benishiryo!!!
    That worked very well!!!
    Thanks a ton!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1