+ Reply to Thread
Results 1 to 5 of 5

Date formula to display day based off of year

  1. #1
    Registered User
    Join Date
    10-01-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2000
    Posts
    3

    Date formula to display day based off of year

    Hi,
    I've attached a file that I am working with. The process I need to follow this this...

    In cell B2 I enter the current year. Cell D1 should always be 1 for January. Cell A5 should display as 'mmmm yyyy' based off of B2+D1.
    I want to take that information and automatically adjust cells B7 through B48 (if necessary) to display the day. Cells A7 through A48 show as Su, M, Tu, W, etc.

    So if it is the year 2013 I want cell B7 to be blank, B8 to be blank, but since January 1 2013 is on a Tuesday I want B9 (Tu from A9) to display as 1, B10 (W from A10) will display as 2. This will repeat on down the line through the 31st where B37 will display as 31.

    Does that make sense to anyone?

    I will eventually have another set of columns that will do the same thing for every month of the year. But hopefully I can figure that out on my own once I see the main example.

    Help would be appreciated!

    Sample.xlsx

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Date formula to display day based off of year

    Hi,

    Why not turn this around and in the first cell A7 enter
    =DATE($B$2,$D$2,ROW()-6)
    custom format it as "ddd" and copy it down 30 rows.

    If required use conditional formatting to colour Sat & Sun with blue.

    In B7:B39 enter the values 1-31.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Date formula to display day based off of year

    You could use this formula in B7

    =IF(MONTH(A$5-WEEKDAY(A$5)+ROWS(B$7:B7))<>D$2,"",DAY(A$5-WEEKDAY(A$5)+ROWS(B$7:B7)))

    format B7 as general and copy down to B43

    That will work for any month/year, so if you change D1/D2 it will update accordingly
    Audere est facere

  4. #4
    Registered User
    Join Date
    10-01-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2000
    Posts
    3

    Re: Date formula to display day based off of year

    Richard, that was a marvelously simple solution. I didn't even think of doing it that way. For some reason my mind had it decided that it was a complex formula that needed to be executed.

    daddylonglegs, thanks for your formula as well. This was exactly what I was thinking in my head.


    Both solutions worked great! Thank you both for replying.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Date formula to display day based off of year

    @ Sovren

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as an infrequent user of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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