Fabian
Fabian

Reputation: 9

How can I create a row of all dates in a month after specifying the month and year in a separate cell?

What I want to do: specify the Month and Year in a cell and create a list of the dates in the specified month. So, it should look like this: the yellow cells are the only cells that should be changed by the user:

Excel Example

I only find examples where you have to manually pull the date down. But that's not what I want, the user should only need to specify month and year. Any ideas?

Upvotes: 0

Views: 928

Answers (1)

BigBen
BigBen

Reputation: 50008

Perhaps could be shortened, but here is an approach using DATEVALUE, DAY, SEQUENCE, and EOMONTH. It may need adjusted based on the date format in your language/Excel settings.

=DATEVALUE(B1&SEQUENCE(DAY(EOMONTH(DATEVALUE(B1&" 1, "&B2),0)))&", "&B2)

enter image description here

Upvotes: 1

Related Questions