+ Reply to Thread
Results 1 to 9 of 9

Count of unique values based on two columns of data

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Duluth, GA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Count of unique values based on two columns of data

    I have a spreadsheet that is completed by a foreman for work completed in a given week. Multiple foreman can work on a job in a given week. I want to determine the number of foreman that worked on a job for each week.

    Example would be

    Column K Column M

    7540 03/04/12
    7540 03/11/12
    6280 03/11/12
    6281 03/11/12
    7540 03/18/12
    6280 03/18/12


    I am only using week ending dates (Sundays) and each forman has a unique id (employee ID) that is being used on the report.

    Column K is where the employee's id is recorded and Column M is the week ending. In the example above, I want a formula that will give me a count of three for the weekending 03/11/12 and a count of two for weekending 03/18/12

    My first post so be patient with me.

    Thanks,
    Jody

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Count of unique values based on two columns of data

    Assuming your data is in rows 1-6, with the date value you're looking for in A1 then try this:

    =SUM(--(IFERROR(MATCH(K1:K6,INDEX(K1:K6*(M1:M6=A1),0),0),-99)=ROW(K1:K6)))

    This is an array formula, so must be entered using Ctrl-Shift-Enter, not just Enter.

  3. #3
    Registered User
    Join Date
    04-02-2012
    Location
    Duluth, GA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Count of unique values based on two columns of data

    { shows up at the beginning fo the formula box, but gives me a result of "True"

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Count of unique values based on two columns of data

    The { should show up, that indicates you've added it as an array formula, so that's fine.

    I can't see how it could return a value of TRUE, however. Is it possible for you to post an example workbook?

  5. #5
    Registered User
    Join Date
    04-02-2012
    Location
    Duluth, GA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Count of unique values based on two columns of data

    Let's see if this posts
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Count of unique values based on two columns of data

    Somehow the formula has ended up in the cell twice. If you delete the entire contents of that cell and then paste in the formula again it should work.

  7. #7
    Registered User
    Join Date
    04-02-2012
    Location
    Duluth, GA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Count of unique values based on two columns of data

    Sweet. Thank you.

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count of unique values based on two columns of data

    Excuse me, but i am curious, Am i missing something? or you can have your result, just using COUNTIF??

    =COUNTIF(M1:M6,A1)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  9. #9
    Registered User
    Join Date
    02-02-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Count of unique values based on two columns of data

    I wonder if you could help me with a similar formula, however in column K i have names of clients and in column M i have the months of the year expressed as a numeric value. I want to count the unique values in column K in an individual month.

    I may want to add in further criteria for Quarter and Year, but I'm sure that once the first formula is figured out i can work to adapt it. I have a separate summary table which reference and i have support columns for Month, Quarter and Year.

+ 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