+ Reply to Thread
Results 1 to 4 of 4

Date and Time Formula problems

  1. #1
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    381

    Date and Time Formula problems

    Hi All,

    I'm having issues with how a formula is working.

    For example,

    A1 B1
    10/06/2013 00:00:00

    A1 is formatted as a date and B1 as a custom (hh:mm)

    A2 has the following formula
    =IF(HOUR(B2)=0,A2+1,A2)

    B2 has
    =B1+"01:00"

    In C1 I need to combine cells A1 and B1 so the formula is simply A1+B1 and then formatted as dd/mm/yyyy hh:mm


    When I drag the formula in A2 and B2 down that's fine, but the formula is C1 seems to work fine for the first 24 hours and then jumps forward by 2 days.

    Not sure why. Any ideas?

    I've attached a text sheet so you can see what I mean...
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Date and Time Formula problems

    B25 shows 00:00 but the actual value is 24:00 because you added 1 hour to 23:00 from the previous cell. One way to make that work is to use this formula in B2 copied down

    =ROUND(MOD(B1+"01:00",1),9)
    Audere est facere

  3. #3
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Date and Time Formula problems

    Hi
    Not sure how you are copying down the formulae but if you retype the "00:00" in B25 or copy and paste B1 to B25 it will correct the issue you have.
    Hope this helps.
    Tony

  4. #4
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    381

    Re: Date and Time Formula problems

    Thanks both, very helpful

+ 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