Enter the first of the month and list days in that month

Tomwhite

New Member
Joined
Apr 3, 2015
Messages
36
Office Version
  1. 365
This is really close to another question about charts but it is a little different:
Because the months change, I want to be able to type the first day of the month in a cell and have the rest of the days automatically fill in, but end at the last day of the month listed. For example, sheet 1 is for January 2021. I want to be able to type 01/01/2021 as a header (I will have it display as Jan-21) then have all of the cells below list all of the days in January, stopping at 01/31/2021. Sheet 2 will be for February 2021. I will enter 02/01/21 and have it fill automatically stopping at 02/28/21. Then 03/01/21 then have it list all days in March without intervention. How do I do that?
Thank you,
Tom
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Drag the formulas down to row 32 to cover the longest months. The cells will remain empty until you enter the first day of the month in A1.
Cell Formulas
RangeFormula
A2:A32A2=IF(A1="","",IF(A1=EOMONTH(A1,0),"",A1+1))
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Depending on your version, another option is
+Fluff 1.xlsm
A
101/01/2021
202/01/2021
303/01/2021
404/01/2021
505/01/2021
606/01/2021
707/01/2021
808/01/2021
909/01/2021
1010/01/2021
1111/01/2021
1212/01/2021
1313/01/2021
1414/01/2021
1515/01/2021
1616/01/2021
1717/01/2021
1818/01/2021
1919/01/2021
2020/01/2021
2121/01/2021
2222/01/2021
2323/01/2021
2424/01/2021
2525/01/2021
2626/01/2021
2727/01/2021
2828/01/2021
2929/01/2021
3030/01/2021
3131/01/2021
Main
Cell Formulas
RangeFormula
A2:A31A2=SEQUENCE(DAY(EOMONTH(A1,0))-1,,A1+1)
Dynamic array formulas.
 
Upvote 0
Forgot to account for a blank cell, so it should be
Excel Formula:
=IF(A1="","",SEQUENCE(DAY(EOMONTH(A1,0))-1,,A1+1))
 
Upvote 0
=IF(A1="","",SEQUENCE(DAY(EOMONTH(A1,0))-1,,A1+1))
Thank you so much for that formula. It got me headed to the right direction. Just a note; This gave me 30 days in January and 27 days in February. I removed the -1 and it seems to work as desired. Thanks again for the help.
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
I have updated my account details. That should help. I didn't realize that was there.
Tom
 
Upvote 0
Glad we could help & thanks for the feedback.
Thanks also for updating your profile.
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

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