+ Reply to Thread
Results 1 to 5 of 5

Counting numerous occurences, matching multiple criteria, only once

  1. #1
    Registered User
    Join Date
    07-22-2013
    Location
    Sydney, NSW
    MS-Off Ver
    Excel 2007
    Posts
    5

    Counting numerous occurences, matching multiple criteria, only once

    Hello,

    I have a large table that contains data for each indivdual item that is part of an order and tracks each stage of an order's progress over the course of a calendar month.
    Amongst a lot of other data, the table records the order number, item code, expected date of dispatch (date), and (if the order was held) the relevant held type.

    Because each row of the table is attributed to an item, all other variables appear multiple times (date, order, etc.) in other columns.
    See the attached sample (data tab). The actual table is considerably larger so I've only represented a small example of the relevant columns.

    I have a summary table in the workbook that I want to count the number of orders that were held on a given day and to list that count in the column relevant to that held type.
    See the attached sample (summary tab).

    I am currently using the following formula (taken from cell B2 on the summary tab):

    =SUMPRODUCT(((Data!A:A<>"")/COUNTIF(Data!A:A,Data!A:A&""))*(Data!C:C=Summary!A2)*(Data!D:D="One"))

    It works.
    But when it is applied to my larger table (that contains more than 3500 rows) it takes too long for excel to run the calculation (sometimes up to 5 minutes) for just one date count.
    When I apply the formula to every date and held type, it often throws back an error that Excel does not have the required resources to complete the calculation.
    The calculation is critical to my monthly reporting but due to the lag of the formula it is taking far too long to produce the report.

    I need a formula that performs the same function but does it more efficiently.
    Please help.

    I am running Excel 2007.
    Attached Files Attached Files

  2. #2
    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,946

    Re: Counting numerous occurences, matching multiple criteria, only once

    I will take a look at it for you. In the mean time, try to use a defined range rather then entire columns, something like...

    =SUMPRODUCT(((Data!A1:A5000<>"")/COUNTIF(Data!A1:A5000,Data!A1:A5000&""))*(Data!C1:C5000=Summary!A2)*(Data!D1:D5000="One"))

    You may be able to use countifS() for this, as well
    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

  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,946

    Re: Counting numerous occurences, matching multiple criteria, only once

    OK try this, copied down and across (change the "One" as needed)...
    =COUNTIFS(Data!$C$2:$C$5000,Summary!$A2,Data!$D$2:$D$5000,"One")

  4. #4
    Registered User
    Join Date
    07-22-2013
    Location
    Sydney, NSW
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting numerous occurences, matching multiple criteria, only once

    Thanks FDibbins.

    Thank you!
    You're first suggestion did the job!

    Your second solution was counting the total number of the held type for each order number on the specified date. I needed the formula to count these as just one occurence.

    Appreciate the assistance.

  5. #5
    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,946

    Re: Counting numerous occurences, matching multiple criteria, only once

    Happy to help and thanks for the feedback

+ 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. [SOLVED] Counting Occurences in a Range based on Specific Criteria
    By artikyulashun in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-24-2012, 12:23 PM
  2. Counting unique occurences with criteria
    By LF123 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2007, 03:21 PM
  3. [SOLVED] counting occurences based on two criteria
    By nackington in forum Excel General
    Replies: 6
    Last Post: 04-20-2006, 08:30 AM
  4. counting occurences from multiple ranges
    By Tomac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2006, 12:25 PM
  5. [B]counting multiple occurences with data missing[/B]
    By Tomac in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2006, 08:06 PM

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