+ Reply to Thread
Results 1 to 2 of 2

Changing a date based on a parameter

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Nevada
    MS-Off Ver
    2011
    Posts
    8

    Changing a date based on a parameter

    I have two columns of shift work data formatted as follows:

    A B
    1/1/12 08:59:32
    1/1/12 13:47:02
    1/2/12 09:17:28
    1/3/12 23:38:57
    1/3/12 01:44:19
    1/4/12 07:00:00

    I did a multiple level sort using the date column first then the time. My issue is that the data system does not switch the date until the time hits 07:00:00 in the morning. So the two highlighted rows will switch places when I run my sort. I tried to fix this by inserting a column before B (putting the time in column C) and ran an if statement saying: B1=IF(C1<07:00:00,A1+1,A1). This did not work and I am having trouble understanding why. I thought it may be a formatting issue??

    Here is an example of the data: https://www.box.com/s/2xhdf9kx17xki7c85nk8
    I put the raw data in the first columns and then next to that is how I tried to create a new "Date" column, and I highlighted the dates with issues in red.

    Also see link for crosspost:http://www.mrexcel.com/forum/excel-q...parameter.html

    Thanks for any help!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Changing a date based on a parameter

    Try
    =IF(C1 < TIMEVALUE("07:00:00"),A1+1,A1).
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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