+ Reply to Thread
Results 1 to 3 of 3

Counting the number of instances of a code in a certain week

  1. #1
    Registered User
    Join Date
    11-01-2004
    Posts
    67

    Question Counting the number of instances of a code in a certain week

    I'm analysing sales data, and our system outputs Week number followed by the order code.

    What I'm trying to do is to find out the number of separate instances that a product is ordered in a week.
    The report looks like this:

    Week no Code
    1 SAR0001
    1 SAR0001
    1 SAR0002
    1 XQL0001
    1 XQL0001
    1 XQL0001
    1 XQR0001
    1 XQR0001
    1 XQR0001
    1 XQR0001
    1 XQR0001
    1 XQR0001
    1 XQR0001

    and the weeks increase down the page.

    I tried using

    =COUNTIF(B:B,AND(N2,M2))

    Where N2 is the week number and M2 is the code I want to match, but it doesn't seem to work.

    Can anyone help?

    Many thanks,

    Chris

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try..

    =SUMPRODUCT(--($A$2:$A$13=N2),--($B$2:$B$13=M2))

    Note that SUMPRODUCT does not accept whole column references.

    Hope this helps!

  3. #3
    Registered User
    Join Date
    11-01-2004
    Posts
    67

    Talking Many thanks

    That does exactly what I was after - many thanks!

    Chris

+ 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