+ Reply to Thread
Results 1 to 6 of 6

Need to Increment Date and Set Time

  1. #1
    Registered User
    Join Date
    03-25-2011
    Location
    Rhode Island
    MS-Off Ver
    Excel 2010
    Posts
    5

    Need to Increment Date and Set Time

    I have a column that contains date/time values. If the time value for that date/time exceeds 6pm, I need to increment the date by one and set the time value to 7:00AM.

    My current calculation seems cumbersome and increments the day by 1 but sets the time value to 12:00AM. If I create another column and do another calculation I can just add 7 hours but I'm assuming I can do this calculation all in 1 cell versus 2 cells.

    Any help is much appreciated!

    Cell value is 3/14/11 8:43 PM

    Current calc is: =IF(TEXT(I585, "h:mm")*1>TIME(18, 0, 0),(DATE(YEAR(I585),MONTH(I585),DAY(I585+1))), VALUE(I585))

    Returns: 3/15/11 12:00 AM

    Second Calc is: =IF(TEXT(J585, "h:mm")*1=TIME(0, 0, 0),(J585+(TIME(7,0,0))), VALUE(I585))

    Which returns: 3/15/11 7:00 AM
    Last edited by jimmy37; 03-25-2011 at 02:42 PM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Need to Increment Date and Set Time

    How about:

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Registered User
    Join Date
    03-25-2011
    Location
    Rhode Island
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need to Increment Date and Set Time

    Quote Originally Posted by ConneXionLost View Post
    How about:

    Please Login or Register  to view this content.
    Cheers,
    Apologies, I just edited out my comments. It works, UE was preventing it from being effective.

    Thank you!
    Last edited by jimmy37; 03-25-2011 at 12:20 PM.

  4. #4
    Registered User
    Join Date
    03-25-2011
    Location
    Rhode Island
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need to Increment Date and Set Time

    I forgot about 1 caveat with the advancing to the next day, I need to exclude weekends...

    So if the input date is Friday, I need to advance to monday at 7:00 AM

    Assuming I need some sort of nested IF in the calculation, but not sure where to start.

    Regards...

  5. #5
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Need to Increment Date and Set Time

    In that case, try:

    Please Login or Register  to view this content.
    Cheers,

  6. #6
    Registered User
    Join Date
    03-25-2011
    Location
    Rhode Island
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Need to Increment Date and Set Time

    Excellent, thank you so much. This forum rocks!

    Regards.

+ 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