+ Reply to Thread
Results 1 to 6 of 6

Formula for setting a value in one cell if it falls within a certain date range

  1. #1
    Registered User
    Join Date
    06-11-2015
    Location
    NE US
    MS-Off Ver
    2013
    Posts
    70

    Formula for setting a value in one cell if it falls within a certain date range

    Hi,

    I am drafting a spreadsheet where in one column I have a set of dates (Jan. 01 through Dec. 31) through a given year and in an adjacent column I would like for it to display the week of the year.

    For example, if I enter a date between Jan. 01 through Jan. 07 then the column next to it will return a value of "01" for the first week of the year. It should be able to do this for any date range and match up the corresponding week of the year.

    Thanks.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,198

    Re: Formula for setting a value in one cell if it falls within a certain date range

    Hi seanpod
    try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    B5 being the cell value that contains the date.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,198

    Re: Formula for setting a value in one cell if it falls within a certain date range

    Oops sorry, that is going to return the week no in the year...Is this what you looking for...

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

    Re: Formula for setting a value in one cell if it falls within a certain date range

    If you always want Jan 1 to Jan 7 to be week 1 (regardless of day of week) then you can calculate based on the number of days so far in the year, e.g. with date in A2 use this formula in B2

    ="WEEK "&TEXT(INT((A2-DATE(YEAR(A2),1,1))/7)+1,"00")
    Audere est facere

  5. #5
    Registered User
    Join Date
    06-11-2015
    Location
    NE US
    MS-Off Ver
    2013
    Posts
    70

    Re: Formula for setting a value in one cell if it falls within a certain date range

    Both responses are precisely what I am looking for, though =weeknum is a much easier version.

    Thanks to both of you

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,198

    Re: Formula for setting a value in one cell if it falls within a certain date range

    Cool. Please mark 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. Replies: 7
    Last Post: 07-14-2017, 12:04 PM
  2. [SOLVED] help with formula to add values up if cell falls within a date range
    By dagummit in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-11-2016, 11:03 AM
  3. [SOLVED] Formula to assign specific numbers if a date falls within a certain date range
    By headley4ever in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2014, 04:16 PM
  4. [SOLVED] Return cell value if date falls within specified range
    By coza in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-10-2013, 03:58 PM
  5. Replies: 15
    Last Post: 04-08-2013, 12:40 PM
  6. Mark cell if location matches and date falls between date range
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2012, 07:54 PM
  7. Replies: 4
    Last Post: 02-18-2009, 09:21 AM

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