# Date function not rolling to next year

#### sheller

##### New Member
Hi Excel wizards,
I have a date formula that is working in all ways except near year-end, when instead of rolling to the next year, it rolls back to the current year. I feel like I'm just missing one small part of the formula, but can't figure it out. Any help appreciated. Thank you!

Formula in cell I2 of the image is as follows: =DATE(YEAR([@[ES_ETA]]), MONTH(EOMONTH([@[ES_ETA]], (DAY([@[ES_ETA]])>25)+1)),1)

#### Attachments

• 2021-11-29 13_00_54-Book3 - Excel.png
8.4 KB · Views: 7

### Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

##### Well-known Member
Hi Sheller,

The YEAR is always that in ES_ETA but you add to the months so the year should change.

I'm not sure why your first two rows should be the 2nd of the month so can you explain or does this do what you ask?

Sheller4.xlsx
HIJ
1ES_ETAES_AVAIL_WHSENOTES
205-Dec-2101-Jan-22
328-Dec-2101-Feb-22
405-Nov-2101-Dec-21
Sheet1 (3)
Cell Formulas
RangeFormula
I2:I4I2=EOMONTH([@[ES_ETA]],(DAY([@[ES_ETA]])>25)+0)+1
Named Ranges
NameRefers ToCells
'Sheet1 (3)'!ES_ETA='Sheet1 (3)'!\$H\$2:\$H\$4I2

[REMOVED]

#### BigBeachBananas

##### Board Regular
Hi Excel wizards,
I have a date formula that is working in all ways except near year-end, when instead of rolling to the next year, it rolls back to the current year. I feel like I'm just missing one small part of the formula, but can't figure it out. Any help appreciated. Thank you!

Formula in cell I2 of the image is as follows: =DATE(YEAR([@[ES_ETA]]), MONTH(EOMONTH([@[ES_ETA]], (DAY([@[ES_ETA]])>25)+1)),1)
Try:
Book2
AB
112/5/20211/1/2022
212/28/20212/1/2022
311/5/202112/1/2021
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=IF(DATE(YEAR(A1), MONTH(EOMONTH(A1, (DAY(A1)>25)+1)),1)<A1,DATE(YEAR(A1)+1, MONTH(EOMONTH(A1, (DAY(A1)>25)+1)),1),DATE(YEAR(A1), MONTH(EOMONTH(A1, (DAY(A1)>25)+1)),1))

#### sheller

##### New Member
Hi Sheller,

The YEAR is always that in ES_ETA but you add to the months so the year should change.

I'm not sure why your first two rows should be the 2nd of the month so can you explain or does this do what you ask?

Sheller4.xlsx
HIJ
1ES_ETAES_AVAIL_WHSENOTES
205-Dec-2101-Jan-22
328-Dec-2101-Feb-22
405-Nov-2101-Dec-21
Sheet1 (3)
Cell Formulas
RangeFormula
I2:I4I2=EOMONTH([@[ES_ETA]],(DAY([@[ES_ETA]])>25)+0)+1
Named Ranges
NameRefers ToCells
'Sheet1 (3)'!ES_ETA='Sheet1 (3)'!\$H\$2:\$H\$4I2
Thank you so much! This is exactly what I was looking for, and the 2nd of the month was a typo on my end (and should have been the first). Thanks again!

##### Well-known Member
Thank you so much! This is exactly what I was looking for, and the 2nd of the month was a typo on my end (and should have been the first). Thanks again!
You're welcome and thanks for the feedback.

Replies
5
Views
195
Replies
6
Views
179
Replies
7
Views
553
Replies
7
Views
234
Replies
0
Views
148

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,477
Messages
5,831,909
Members
430,090
Latest member
bjonesh2o

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