+ Reply to Thread
Results 1 to 4 of 4

counting week number of two different years

  1. #1
    Forum Contributor
    Join Date
    03-16-2010
    Location
    Phnom Penh, Cambodia
    MS-Off Ver
    Excel 2003
    Posts
    215

    counting week number of two different years

    Dear All,

    I am trying to count week number of two different years. However, i cannot distinguish those two week numbers of the two years.

    For example, 17/Dec/17 & 17/Dec/16 fall on the same week number which is WEEK51. How am I going to only match the WEEK51 to 2016 & another WEEK51 to 2017?

    The attachment is the excel file which i am trying to work on.

    Your advise will be very much appreciated.

    Regards,
    sanlen
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,335

    Re: counting week number of two different years

    In F5 drag copied across:

    =SUMPRODUCT(($D$7:$D$18=F4)*(YEAR($C$7:$C$18)=F3))

    Your count in F6 is wrong, by the way - it should be 2.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: counting week number of two different years

    I don't want to be a smart ***, but there are some dates where the week-year is not equal to the date-year
    See my attachment for explanation.
    For those dates (only in the first week of some years or in the last week) my formula works correct.
    I know from professional experience that working with weeknumbers is sometimes a pain in the ***.
    Attached Files Attached Files
    Kind regards,
    Piet Bom

  4. #4
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: counting week number of two different years

    another unexplainable thing from MS
    ISOWEEKNUM works in SUMPRODUCT
    WEEKNUM does not, even in array formula
    Attached Files Attached Files
    Last edited by tim201110; 12-18-2017 at 09:36 AM.

+ 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. Counting number of years from date to today
    By profitdr123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-13-2015, 02:42 AM
  2. [SOLVED] Counting the number of occurrences before the current week #
    By jtmoore in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-11-2014, 10:40 AM
  3. counting the number of dates that fall within a given week
    By john dalton in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-11-2013, 05:40 PM
  4. [SOLVED] Counting data by week number
    By Scopar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2006, 04:25 AM
  5. [SOLVED] counting number of times value is greater than previous week
    By tereasajw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-19-2005, 10:55 AM
  6. Replies: 0
    Last Post: 08-23-2005, 12:36 PM
  7. Replies: 2
    Last Post: 04-29-2005, 05:56 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