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

#### MurraySMTH

##### Board Regular
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.

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

#### Joe4

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.
One way:
=IF((L3-INT(L3))>0,INT(J3)+1,INT(J3))

#### gaz_chops

##### Well-known Member
Try

=IF(L3>0.5,J3+1,J3)

#### Rick Rothstein

##### MrExcel MVP
If cell J3 contains a real date (not a text one), then this should work...

=INT(J3)+(L3>0.5)

#### Joe4

Rick and gaz_chops,

Isn't 12:00 AM midnight and not noon (12:00 PM is noon, which is half a day)?
Since their formula wasn't working correctly, I went by their description and not their formula.

#### MurraySMTH

##### Board Regular
These are the formats i am using.

#### gaz_chops

##### Well-known Member

Oops i misread it! Thinking of 12 hours!!

#### Rick Rothstein

##### MrExcel MVP
Rick and gaz_chops,

Isn't 12:00 AM midnight and not noon (12:00 PM is noon, which is half a day)?
Since their formula wasn't working correctly, I went by their description and not their formula.
The only reason I assumed the OP meant noon is because all times are greater than midnight (except midnight itself I guess), so you would always be adding 1. Since that would make the question's wording strange (why wouldn't the OP have just asked how to add one day), I assume the OP meant midday.

#### Joe4

MurraySMTH,

What column are you putting this formula in?

Even though K and L only show times doesn't necessarily mean they don't have a date component (actually, all valid time entries do, it is just that the date part is hidden by using a format that only shows time). So how are K and L being populated? Manually? By a formula (if so, please post the formulas)?

#### MurraySMTH

##### Board Regular
Joe,

I will be adding 1 day to column J that will determine the time from column L

Replies
3
Views
237
Replies
23
Views
743
Replies
2
Views
88
Replies
10
Views
776
Replies
7
Views
138

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,891
Messages
5,834,263
Members
430,273
Latest member
Windrunner

### 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.

### Which adblocker are you using?

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

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