+ Reply to Thread
Results 1 to 4 of 4

Count distinct records that meet multiple conditions

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Count distinct records that meet multiple conditions

    I've come to a brick wall on a specific formula and I'm hoping someone has either a way to knock it down or at least work around it.

    As part of a larger formula, I have a table from which I'm trying to count the number of people who, during each month, worked more than zero hours.

    For example:
    employee month hours_worked
    david 1 0
    david 2 5
    david 3 9
    mike 1 0
    mike 2 0
    mike 3 6
    month worked
    1 0
    2 1
    3 2

    The summary table in which I'd like the final counts to show has the month numbers as headers.

    I've run out of math power for the day. If anyone has any insight, please share. And if I didn't title this in a way that makes sense, let me know and I'll adjust.

  2. #2
    Valued Forum Contributor
    Join Date
    05-13-2010
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Excel 2003; 2007
    Posts
    441

    Re: Count distinct records that meet multiple conditions

    rubthebuddha, Good evening.

    Using your layout:

    DATA
    Column A = employee
    Column B = month
    Column C = hours_worked

    SUMMARY:
    Column B = month
    Column C = worked

    DO:
    C11 --> =SUMPRODUCT(($C$2:$C$7>0)*($B$2:$B$7=B11))
    C12 --> =SUMPRODUCT(($C$2:$C$7>0)*($B$2:$B$7=B12))
    C13 --> =SUMPRODUCT(($C$2:$C$7>0)*($B$2:$B$7=B13))

    Is it what you desired?
    I hope it helps.
    ...If my answer helped you, Please, click on. * Add Reputation (at left)

    Best regards.
    Marc?lio Lob?o

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Count distinct records that meet multiple conditions

    Here are a couple of ways to calculate what you want:
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Registered User
    Join Date
    08-03-2012
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Count distinct records that meet multiple conditions

    I'm writing letters to Santa on behalf of both of you. However, I failed to mention that each person will have multiple records each month, hence the difficulty with me on the count distinct part.

+ 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] Count records that meet mutiple conditions in multiple sheets
    By RogerRangeRover in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2012, 06:56 AM
  2. Replies: 5
    Last Post: 03-13-2012, 06:05 AM
  3. Replies: 4
    Last Post: 11-08-2010, 08:32 AM
  4. Count Distinct Records - Criteria
    By Thommo in forum Excel General
    Replies: 5
    Last Post: 08-24-2009, 05:49 PM
  5. Count records that meet multiple criteria
    By statenja in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2008, 01:53 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