Date function not rolling to next year

sheller

New Member
Joined
Dec 12, 2016
Messages
22
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
    2021-11-29 13_00_54-Book3 - Excel.png
    8.4 KB · Views: 9

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
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
 
Upvote 0
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))
 
Upvote 0
Solution
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!
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,525
Members
448,969
Latest member
mirek8991

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