Array of month days in a row

jl2509

Board Regular
Joined
Oct 30, 2015
Messages
198
Office Version
  1. 365
Platform
  1. Windows
Hi all

Can anyone please provide a solution to creating an array of days for a given month as per the table below.

ABCDEFGHIJ......
Jan12345678thru 31

The array of dates staring in B1 should stop at the number of days per month based on what month (in text) is in A1 i.e. Jan = 31, Feb = 28 (leap year dependent)

Appreciate the help
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi assuming you have a reasonably modern version of Excel then you can try:
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1Jan12345678910111213141516171819202122232425262728293031
Sheet1
Cell Formulas
RangeFormula
B1:AF1B1=SEQUENCE(,DAY(EOMONTH("1"&A1,0)))
Dynamic array formulas.
 
Upvote 0
Thanks for the response.

This works fine for what I need.

Much appreciated.
 
Upvote 0
Hi
To take this a step further, if you add 2 rows above the current data, and in Cell A1 add the calendar year "2024", how do you make the day of the week dynamic starting at Cell B2, based on the date now in row 3. Can this also be an array?
i.e.
1698681682520.png
 
Upvote 0
Hi, you could try like this:

Book5
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
12024
2MonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWedThuFriSatSunMonTueWed
3Jan12345678910111213141516171819202122232425262728293031
Sheet1
Cell Formulas
RangeFormula
B2:AF2B2=TEXT(DATE(A1,MONTH(1&A3),B3#),"ddd")
B3:AF3B3=SEQUENCE(,DAY(EOMONTH(A3&A1,0)))
Dynamic array formulas.
 
Upvote 0
Solution
Thanks for the reply
I get a very odd result where either formula shows the day as Sun for cell B2?
Even if I use =TEXT(WEEKDAY(B3), "ddd") it shows as Sun?
The 1st Jan 2024 is Mon as your example shows?
 
Upvote 0
Hi

Please ignore my ramblings. I had a typo

Your solution works perfect

Thank you
 
Upvote 0
Please ignore my ramblings. I had a typo
I did delete and re-post my suggestion so you may have been looking at the first version I posted that was seriously flawed!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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