+ Reply to Thread
Results 1 to 9 of 9

Subtracting Dates

  1. #1
    Registered User
    Join Date
    04-13-2009
    Location
    Upstate NY
    MS-Off Ver
    Excel 2003
    Posts
    14

    Subtracting Dates

    I have 2 cells in a row that are times, it has been a while since I did any work in excel. I want to take the first cell as start Time, the second cell is end time and I need to subtract them and put the total in a cell called Hours. What is the correct format to use and how would I do the subtraction.

    Generally start time will be AM and End Time will be PM.

    Thank you for your help
    CoachBarker
    Last edited by NBVC; 04-13-2009 at 02:03 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Subtracting Dates

    Probably something like:

    =(F1-E1)*24

    Where E1 contains start time and F1 contains end time...

    format the cell as General or Number...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-13-2009
    Location
    Upstate NY
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Subtracting Dates

    Now if I take a 30 minute lunch every day, say one column called Lunch, if it says Yes I took a lunch and want to lose .5. if it is blank subtract nothing.

    DaysWorked.JPG

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Subtracting Dates

    Try

    =(D3-B3-IF(E3="Yes",0.5,0))*24

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Subtracting Dates

    -if(e10="y";0,5;0)

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Subtracting Dates

    Quote Originally Posted by zbor View Post
    -if(e10="y";0,5;0)
    Please read entire thread and try not to confuse the situation.

  7. #7
    Registered User
    Join Date
    04-13-2009
    Location
    Upstate NY
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Subtracting Dates

    That does work in the first row, but then in the rest of the Week 1 for totals I get -6,-4,-4,-4.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Subtracting Dates

    Please post the actual worksheet in .xls format so that we can see what exactly you need.

  9. #9
    Registered User
    Join Date
    04-13-2009
    Location
    Upstate NY
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Subtracting Dates

    I've got it to work, had a format wrong on the cells. Thanks for your quick reply to my first post, I haven't really done any excel work since school.

    Thanks
    CoachBarker

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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