I have a sheet where the user is supposed to pick a Month-Name from a dropdown in one cell A2. I want a formula that populates the dates in the row depending on the month picked. Please me in this case.
Thanks in advance.
CodePudding user response:
Perhaps you may try this :
• If you are using MS365
then use
=SEQUENCE(DAY(DATE(YEAR(TODAY()), MONTH(B2 &0) 1, 1) -1),,DATE(YEAR(TODAY()),MONTH(B2&1),1))
• if not then try the one below,
=DATE(YEAR(TODAY()),MONTH(B2&1),ROW(INDIRECT("1:"&DAY(DATE(YEAR(TODAY()),MONTH(B2&0) 1,1)-1))))
Edit: Since OP is using Excel 2013, may try this out:
• Formula used in cell E4
=IF(ROWS(E$4:E4)>DAY(EOMONTH(DATE(YEAR(TODAY()),MONTH($D$4&1),1),0)),
"",DATE(YEAR(TODAY()),MONTH($D$4&1),ROW(A1)))