Auto-Update Date Based on Cell Input

acool

Board Regular
Joined
Feb 10, 2023
Messages
121
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I am currently trying to create a formula in cell C2:N2 which will auto update months/year based on the starting value in cell X2. For example, if X2 is change to 2/1/2024, I would like Cell C2 to update to Feb-2024 and as well as the have remaining 11 months to update. Any help would be greatly appreciated. Thank you for your help in advanced.

1710968280572.png
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try
Excel Formula:
=MAKEARRAY(1,12,LAMBDA(r,c,EOMONTH(X2,0)+(c-1)))
 
Upvote 0
A non-lambda formula version:

Book1.xlsx
CDEFGHIJKLMNOPQRSTUVWX
112 Months Forecast
2Jan-2024Feb-2024Mar-2024Apr-2024May-2024Jun-2024Jul-2024Aug-2024Sep-2024Oct-2024Nov-2024Dec-2024Start Date1/1/2024
Sheet2
Cell Formulas
RangeFormula
C2C2= DATE(YEAR($X$2), MONTH($X$2)+0, 1)
D2D2= DATE(YEAR($X$2), MONTH($X$2)+1, 1)
E2E2= DATE(YEAR($X$2), MONTH($X$2)+2, 1)
F2F2= DATE(YEAR($X$2), MONTH($X$2)+3, 1)
G2G2= DATE(YEAR($X$2), MONTH($X$2)+4, 1)
H2H2= DATE(YEAR($X$2), MONTH($X$2)+5, 1)
I2I2= DATE(YEAR($X$2), MONTH($X$2)+6, 1)
J2J2= DATE(YEAR($X$2), MONTH($X$2)+7, 1)
K2K2= DATE(YEAR($X$2), MONTH($X$2)+8, 1)
L2L2= DATE(YEAR($X$2), MONTH($X$2)+9, 1)
M2M2= DATE(YEAR($X$2), MONTH($X$2)+10, 1)
N2N2= DATE(YEAR($X$2), MONTH($X$2)+11, 1)


Then, format the cells as "MMM-YYYY"
 
Upvote 0
There's a mistake in this formula above in post #2. It should've been this

Excel Formula:
=MAKEARRAY(1,12,LAMBDA(r,c,EOMONTH(X2,c-1)))
 
Upvote 0
Solution
Another option
Excel Formula:
=EDATE(X2,SEQUENCE(,12,0))
 
Upvote 0
There's a mistake in this formula above in post #2. It should've been this

Excel Formula:
=MAKEARRAY(1,12,LAMBDA(r,c,EOMONTH(X2,c-1)))
This worked! Thanks everyone for your help!
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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