+ Reply to Thread
Results 1 to 12 of 12

How to get dates based on a month

  1. #1
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    How to get dates based on a month

    Hi, I am creating a workbook to help me keep track of the hours I have worked, so I want to create a document with 12 sheets 1each month.

    Is there a formula that can write the dates for me in the ?Date? column based on the ?Month? and ?Year? i input in the relative cells?

    F4612338-1E60-4EAF-AD00-ED9C0B4F4BD1.jpeg

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,721

    Re: How to get dates based on a month

    How about in C6 only
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    clear all cells below C6 first

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,259

    Re: How to get dates based on a month

    Clear your column of dates, then try this in C6:

    =LET(sd,DATEVALUE(E2&" 1"),SEQUENCE(DAY(EOMONTH(sd,0)),1,sd,1))
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: How to get dates based on a month

    Quote Originally Posted by Fluff13 View Post
    How about in C6 only
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    clear all cells below C6 first
    I get THE FIRST ARGUMENT OF LET MUST BE A VALID NAME

    Also does this formula take in consideration the Year?

  5. #5
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: How to get dates based on a month

    Quote Originally Posted by AliGW View Post
    Clear your column of dates, then try this in C6:

    =LET(sd,DATEVALUE(E2&" 1"),SEQUENCE(DAY(EOMONTH(sd,0)),1,sd,1))
    This does change the dates (day and month) but the year is 2001, i would like the formula to keep in consideration what year do i write in the year cell so in E3

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,259

    Re: How to get dates based on a month

    Amendment:

    =LET(d,DATEVALUE(E2&" 1"),sd,DATE(E3,MONTH(d),DAY(d)),SEQUENCE(DAY(EOMONTH(sd,0)),1,sd,1))
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,721

    Re: How to get dates based on a month

    I get THE FIRST ARGUMENT OF LET MUST BE A VALID NAME
    Works for me
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,259

    Re: How to get dates based on a month

    Quote Originally Posted by Bluesky0094 View Post
    This does change the dates (day and month) but the year is 2001, i would like the formula to keep in consideration what year do i write in the year cell so in E3
    See post #6.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,259

    Re: How to get dates based on a month

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

  10. #10
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: How to get dates based on a month

    Quote Originally Posted by AliGW View Post
    Amendment:

    =LET(d,DATEVALUE(E2&" 1"),sd,DATE(E3,MONTH(d),DAY(d)),SEQUENCE(DAY(EOMONTH(sd,0)),1,sd,1))
    Thanks a lot this works, I have done my own adjustments and changed with cell E3 where you typed 2022 so now the sheet work as i want..
    thank you so much

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: How to get dates based on a month

    If you want a solution that will work in versions of Excel that do not have the LET or SEQUENCE functions, you can do this:

    First of all, ensure that you spell the month name correctly in cell E2, or set this up with data validation so you can choose it from a list.

    Then you can use this formula in cell C6:

    =IFERROR(DATE(E3,INT((SEARCH(LEFT(E2,3),"JanFebmarAprMayJunJulAugSepOctNovDec")-1)/3)+1,1),"")

    Note that you only have to enter the first 3 letters of the month in E2 for this to work. Then use this formula in C7:

    =IF(C6="","",IF(MONTH(C6+1)<>MONTH(C6),"",C6+1))

    Copy this down to C36 (i.e. for a full 31 days), and this will automatically adjust for months of 28, 29 or 30 days.

    Hope this helps.

    Pete

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,259

    Re: How to get dates based on a month

    E3 was already in the formula.

    You are welcome. Please mark the thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dollar sum lookup based on month and dates
    By nickpavlov in forum Excel General
    Replies: 14
    Last Post: 02-27-2019, 01:27 AM
  2. [SOLVED] Days in Month based on dates
    By SharpL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2016, 06:38 AM
  3. SUMIF a month name based on a column of dates
    By lorber123 in forum Excel General
    Replies: 3
    Last Post: 06-24-2016, 09:25 PM
  4. Create column of dates based on Month
    By maxi0009in in forum Excel General
    Replies: 1
    Last Post: 08-05-2015, 08:04 AM
  5. Replies: 18
    Last Post: 03-24-2013, 04:20 PM
  6. Based on col dates create col of dates for the first day of that same month and year
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2011, 09:32 PM
  7. [Solved] SUMIF based on dates (month)
    By Russell719 in forum Excel General
    Replies: 4
    Last Post: 10-19-2010, 01:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1