+ Reply to Thread
Results 1 to 9 of 9

Formula to calculate days from Monday

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Formula to calculate days from Monday

    Hi,

    I am new to this site and am trying to determine a formula that can output how many days from Monday I am.

    I have a product that expires 273 days from the monday of the current week.

    Example todays product would expire 273 days from 4/1 (Monday). Tomorrow's would expire 273 days from 4/1 also.

    What I am in need of is a calculation that can look at todays date and know that it was one day ago that it was monday and calculate 39 weeks from yesterday. Tomorrows would know to calculate back 2 days so that the expiration date from Monday - Sunday is all expiring 273 days from that weeks monday

    My current calcuation takes 273+todays date (insert calculation that determines wed is three days)

    Any help would be appreciated

    Thank You!

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Formula to calculate days from Monday

    hi astaticpunk, welcome to the forum. use WEEKDAY to return the day of the week.
    =WEEKDAY(TODAY(),2)+1

    the "2" behind returns 1 for Mon, 7 for Sunday. so if today is Wed, it takes today's date minus 3. that will give you Sunday of last week. so add plus 1 to it

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formula to calculate days from Monday

    Hi and welcome to the forum

    weekday(today(),2) will give you today (wednesday 3 April) as 3, so you could use something like =weekday(today(),2)-(weekday(today(),2)-1) to give you monday (1) and then add your days to that?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    04-02-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Formula to calculate days from Monday

    Hi,

    Thanks for the information. How can I have Monday = 0, Tues =1, Wed = 2, Thu=3, Fri =4, Sat =5, Sun=6 ?

  5. #5
    Registered User
    Join Date
    04-02-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Formula to calculate days from Monday

    What would it be with Mon=0, Tues = 1, etc. Monday doesn't need any values added to it so it should always have 0 and add the days to it

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formula to calculate days from Monday

    change the ,2 to ,3

  7. #7
    Registered User
    Join Date
    04-02-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Formula to calculate days from Monday

    Thats perfect. Thank you!

    I don't suppose you know how I could write this into a programing type language. It's for a piece of labeling software. When input as is, it returns a syntax error

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formula to calculate days from Monday

    sorry, my VBA sux

  9. #9
    Registered User
    Join Date
    04-02-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Formula to calculate days from Monday

    For some reason it's only outputting 1 regardless of what date it is

    =weekday(today(),3)-(weekday(today(),3)-1)

    Even if I change my clock to say thurs it should show 3

+ 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