IF statement adding a day to a date from 12:00am - Help!

MurraySMTH

Board Regular
Joined
Jun 30, 2020
Messages
81
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I am trying to solve a simple IF statement by adding one day to a date from a cell containing time.

=IF(L3>Time(12,00,0)Datevalue(J3+1))

So if L3 is higher that 12:00am add one day to the date in J3

If this is not the case, no change to date.

Thank you for any effort provided! Love this forum.
 
MurraySMTH,

Sorry, it still isn't exactly clear to me. I think the fact that you have 3 long-time members reply, and none can really agree on what you are after shows that your question needs to be clarified. Remember, while it is clear to you because you have been working on it, all that we have to go on is what you tell us.

I recommend walking us through an actual example every step of the way. For example, pick any row, tell us is what is in each cell, and based on that what should happen and where. Just explain all the logic and details in plain English (no formulas, since those weren't working for you in the first place).
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
MurraySMTH,

Sorry, it still isn't exactly clear to me. I think the fact that you have 3 long-time members reply, and none can really agree on what you are after shows that your question needs to be clarified. Remember, while it is clear to you because you have been working on it, all that we have to go on is what you tell us.

I recommend walking us through an actual example every step of the way. For example, pick any row, tell us is what is in each cell, and based on that what should happen and where. Just explain all the logic and details in plain English (no formulas, since those weren't working for you in the first place).


Great Suggestion Joe,

Column K and L have time-span start times and time-span end times, I will need to add one day to the date found in column J, only if column L goes on to the next day.

So 10:15pm in column K is the start while column L is 4:45am is the end which goes into the next day. I will then need to add 1 day to column J, if this occurs. If it does not, nothing should change.

1595265189029.png
 
Upvote 0
Oh, so that is what you wanted. Okay, give this a try...

=J3+DAY(L3+K3)-DAY(J3+K3)
 
Upvote 0
Rick, When it adds a day to column J, it is giving me the result of 1/0/1900
 
Upvote 0
Column K and L have time-span start times and time-span end times, I will need to add one day to the date found in column J, only if column L goes on to the next day.

So 10:15pm in column K is the start while column L is 4:45am is the end which goes into the next day. I will then need to add 1 day to column J, if this occurs. If it does not, nothing should change.
Ok, you still haven't told us everything. Let's look at the first example you highlighted. So the calculated date would be 3/13/2020.
But what are you actually doing with this date? Are you putting it somewhere (like in column M), or are you overwriting some value?

Also, I think we need to know what the date portion of columns K and L actually are.
If you temporarily change their format to show both date and time, what does it show for the date part?
 
Upvote 0
No, just a crap, couldn't-work-if-it-tried formula. Let me rethink this and get back to you.
 
Upvote 0
Assuming the difference between start and end times is never more than 24 hours, give this a try...

=J3+(L3<K3)
 
Upvote 0
Ok, you still haven't told us everything. Let's look at the first example you highlighted. So the calculated date would be 3/13/2020.
But what are you actually doing with this date? Are you putting it somewhere (like in column M), or are you overwriting some value?

Also, I think we need to know what the date portion of columns K and L actually are.
If you temporarily change their format to show both date and time, what does it show for the date part?

Joe,

Yes I just want to add one day to column j. so 3/12/2020 would be 3/13/2020...

If i filter date and time 1/0/00 12:00AM

I am adding this formula to column J.
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,649
Members
448,975
Latest member
sweeberry

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