Changing a date based on a parameter

cpotts13

New Member
Joined
Feb 5, 2013
Messages
23
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.

Thanks for any help!
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,831
Messages
6,127,138
Members
449,361
Latest member
VBquery757

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top