+ Reply to Thread
Results 1 to 4 of 4

Summarize data based on multiple criteria

  1. #1
    Registered User
    Join Date
    01-06-2010
    Location
    concord, ca
    MS-Off Ver
    Excel 2003
    Posts
    3

    Summarize data based on multiple criteria

    I have a worksheet with several columns of data that I have to summarize elsewhere on the sheet. Here are the columns:

    ID
    Status
    Joined
    Name

    Name can take on 4 possible values. For each value in Name, I want to count the number of cells in a column that fit certain criteria. Here are the counts I want to make:

    Status OK: Status is a date.
    Joined OK: Status is a date and Joined is a "1".

    There are going to be about 500 records to count. I've already implemented these counts in a Windows scripting language that interfaces with Excel, but I know there must be a more direct and faster way to do it entirely in Excel, whether with VBA or writing functions into cells.

    I have attached a copy of the sheet with sample data on it.
    Attached Files Attached Files
    Last edited by sigil; 01-06-2010 at 08:57 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Summarize data based on multiple criteria

    In G4:

    =SUMPRODUCT(--($D$2:$D$9=$F4),--ISNUMBER($B$2:$B$9))

    in H4:

    =SUMPRODUCT(--($D$2:$D$9=$F4),--ISNUMBER($B$2:$B$9),--($C$2:$C$9=1))

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-06-2010
    Location
    concord, ca
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Summarize data based on multiple criteria

    Thanks, that works great for the finite case where I already know how many records I have, but I also want it to work if I add more records to my list.

    I tried replacing

    =SUMPRODUCT(--($D$2:$D$9=$F4),--ISNUMBER($B$2:$B$9))

    with

    =SUMPRODUCT(--(D:D=$F4),--ISNUMBER(B:B))

    so that I could include all entries in columns B & D no matter how many I added, but I got a #NUM! error as a result.

  4. #4
    Registered User
    Join Date
    01-06-2010
    Location
    concord, ca
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Summarize data based on multiple criteria

    Never mind, fixed it. I just set the array as $D$2:$D$65000.

    Thread solved.

+ 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