+ Reply to Thread
Results 1 to 7 of 7

Appointing a number based on a date (to effectively create a round or week count)

  1. #1
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Question Appointing a number based on a date (to effectively create a round or week count)

    I'm looking to add a round or week count to some sports data (so that I can do something else with the round or week number) and I have fixtures for this year's English Premiership based on the date played. You can see that I have managed to figure out the first bit (cell H13, where I have treated the opening day of the season in B2 as effectively the starting point) and was intending to reference everything from here (e.g. after 7 days would be week 2, 14 days from B2 would be week 3 etc.).

    I was thinking that I could do a massive IF formula with say 38 terms for 38 weeks, but wondered if there was a slightly more elegant way of doing this.

    I'd be grateful for anyone's advice on this and am quite happy to discuss.

    Thanks in advance,

    Fixtures_Adjustment_12_13.xls

  2. #2
    Forum Contributor
    Join Date
    10-02-2012
    Location
    Bumi Nusantara
    MS-Off Ver
    Excel 2010; Excel 2016
    Posts
    136

    Re: Appointing a number based on a date (to effectively create a round or week count)

    in cell H2:

    =WEEKNUM(DATE(YEAR(B2),MONTH(B2),DAY(B2)-4))-32

    copy down

  3. #3
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Re: Appointing a number based on a date (to effectively create a round or week count)

    Spot on and solved. Another day and a new Excel function to learn about. Looking at it, I figured you'd have to $ the B2 (as I figured that would be the day 1 key), but it actually works around that. Real nice work (I didn't realise you could do sums with dates until this morning, when I came up with the idea to try and do something with some data that I had). I take it the date function is effectively the key to getting the weeknum to refer to B2?, and out of interest the 32 is for?

    Thanks again,
    Last edited by Cutter; 10-20-2012 at 04:54 PM. Reason: Removed whole post quote

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Appointing a number based on a date (to effectively create a round or week count)

    Elegant solution:

    =INT((B2-B$2)/7)+1

    copy down as far as needed

  5. #5
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Re: Appointing a number based on a date (to effectively create a round or week count)

    Splitting ends, but more elegant and I get this one, creating an integer based on the B2 and keying it and dividing by 7 (to allow for the week) and the +1, to avoid the 0 issue. Nice.
    Last edited by Cutter; 10-20-2012 at 04:54 PM. Reason: Removed whole post quote

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

    Re: Appointing a number based on a date (to effectively create a round or week count)

    Quote Originally Posted by dwint View Post
    =WEEKNUM(DATE(YEAR(B2),MONTH(B2),DAY(B2)-4))-32
    This will work OK until you get to 5th January, then you'll get neagtive numbers........
    Audere est facere

  7. #7
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London England
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    157

    Re: Appointing a number based on a date (to effectively create a round or week count)

    Thanks for the heads up on this (and sorry for the lateness of this - I haven't been on the forum in a while). I went with Teethless's solution in the end anyhow as I could figure out the formula for that one, whereas I couldn't figure out dwint's formula. Is it possible doing it that way?
    Last edited by Cutter; 10-20-2012 at 04:55 PM. Reason: Removed whole post quote

+ 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