+ Reply to Thread
Results 1 to 11 of 11

Count Unique Values With Multiple Creteria.

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Question Count Unique Values With Multiple Creteria.

    I am looking for simple macros with an be amend in future to count unique values based on multiple criteria. I have other tables also. If anyone helps me I will get the idea and will manage to do other tables.

    I have a list in worksheet named Data and a table in Calculation Result. Here are the details what I am requesting.

    The scrip should look for Staff in column E and age below 65 years in column D for worksheet Data and count the values for match criteria and return the values in worksheet Calculation Result in cell B4. If the age is above then return the values in Cell E65. That’s how it goes.

    Sample worksheet is attached with the result is attached for your reference.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-14-2012
    Location
    Penang, Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Count Unique Values With Multiple Creteria.

    @hecgroups,

    Please try this : https://www.box.com/s/319bfipzcvdtlo8cbapf

    Moderator's Note: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter...Thanks.
    Last edited by jeffreybrown; 12-15-2012 at 11:05 AM.

  3. #3
    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 Unique Values With Multiple Creteria.

    In E5 and copy down this will work. Same for the others.

    =SUMPRODUCT((Data!$D$2:$D$301>65)*(Data!$E$2:$E$301="Staff")*(Data!$C$2:$C$301=A5))
    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.

  4. #4
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Count Unique Values With Multiple Creteria.

    have a review to attached workbook
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Count Unique Values With Multiple Creteria.

    Thank you for your response. If you can provide me VBA Macros for the same. i am using the formulas but it is taking lot of time to update all the tables.
    Last edited by hecgroups; 12-14-2012 at 08:08 AM.

  6. #6
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Count Unique Values With Multiple Creteria.

    u need Macro for this output , what happen that formula did not work ?

  7. #7
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Count Unique Values With Multiple Creteria.

    i will update macro for u dont wory just i need small clarifcation is it u will have only 6 relation only or it will increase

  8. #8
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Count Unique Values With Multiple Creteria.

    Mr. Naveed,

    Please check this SCREENSHOT.

    I have these tables which i need macros but if you do for 1 I will manage for others.

    The classes will be fixed.

  9. #9
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Count Unique Values With Multiple Creteria.

    Hi,

    ok i will get back to u with solution now i hv to go institute please don't mine anything.

    Thanks - Naveed.

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Count Unique Values With Multiple Creteria.

    Here's one way.

    Please Login or Register  to view this content.
    Last edited by mike7952; 12-14-2012 at 10:45 AM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  11. #11
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Count Unique Values With Multiple Creteria.

    Thanks mike7952.

    This is what i am looking. I have to work for other tables also if i have any problem i will get back to you or PM the new topic. Thanks for your valuable time.

+ 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