+ Reply to Thread
Results 1 to 14 of 14

Finding unique combinations across 3 columns using a function

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Finding unique combinations across 3 columns using a function

    Dear all,

    Here's the situation. I have 3 columns. Column 1 has years (2010-2011, 2011-2012, 2012-2013, etc.). Column 2 has periods (P1 P2, P3, etc.), Column 3 has names of people. (see below)

    How do I find the number of unique occurences for a name associated with same periods and same years. For example, there are 2 occurences for Goldberg, Jane, in P14, in 2012-2013, 1 occurence for her name in 2009-2010, P1 and one other unique occurence for her name in 2009-2010, P12.

    I want to be able to find the number of those occurences using a formula (not by using filters).

    Thank you for your help!


    Year Periode Name
    2012-2013 P1 Smith, John
    2011-2012 P14 Blaum, John
    2012-2013 P14 Goldberg, Jane
    2012-2013 P14 Goldberg, Jane
    2009-2010 P1 Goldberg, Jane
    2012-2013 P2 Ahluwalia, Harveen
    2010-2011 P3 Alaoui, Ismail
    2010-2011 P4 Alaoui, Woualid
    2012-2013 P5 Alborzi, Zoubin
    2011-2012 P6 Allen, David
    2012-2013 P7 Smith, Henry
    2009-2010 P8 Amato, Carmelo
    2011-2012 P9 Roosevelt, Anderson
    2012-2013 P10 Roosevelt, Anderson
    2009-2010 P11 Mbogo, Togo
    2009-2010 P12 Goldberg, Jane
    2012-2013 P13 Abramovitz, John
    2012-2013 P15 Lisitsa, Carolina
    2010-2011 P15 Lisitsa, Carolina
    2010-2011 P16 Ascah, John Edward
    2012-2013 P17 Bianci, Antonio
    2009-2010 P18 Atkins, Charles
    2012-2013 P19 Johnson, Eric
    2010-2011 P20 Johnson, Eric
    2012-2013 P21 Baldassarre, Carolina
    2011-2012 P22 Baras, Ahmed-Youssef

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding unique combinations across 3 columns using a function

    Please attach a sample workbook with expected output for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    05-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding unique combinations across 3 columns using a function

    test2.xlsx
    Quote Originally Posted by :) Sixthsense :) View Post
    Please attach a sample workbook with expected output for better understanding
    File attached.

  4. #4
    Registered User
    Join Date
    05-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding unique combinations across 3 columns using a function

    Re-reading my question, I think I phrased it incorrectly. What I need is to know, for each combination of year and period, how many unique names there are. You can see the expected output in the file.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding unique combinations across 3 columns using a function

    Can be done easily with the help of pivot table, refer the attached file for details
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding unique combinations across 3 columns using a function

    Quote Originally Posted by :) Sixthsense :) View Post
    Can be done easily with the help of pivot table, refer the attached file for details
    Thanks, but I should have mentioned that for the purpose of what I'm doing I need this to be done in the form of a function.

    Is there a way to do that?

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding unique combinations across 3 columns using a function

    Sorry, I wont go for hard approach when it is easily done by another one, so I believe that someone will help your for your new requirement

  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: Finding unique combinations across 3 columns using a function

    Maybe in I3 and copy down?

    =SUMPRODUCT((Tableau1[Year]=G3)*(Tableau1[Period]=H3))
    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
    05-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding unique combinations across 3 columns using a function

    @ Sixthsense: thanks for your help, but I really need this to be in functions form. As i add data I need the output to update automatically, I cannot re-create pivot tables.

    @Fotis: thanks for your help. I tried your formula, the problem is that it counts every occurence of year and period combinations. eg.: for "2012-2013 and P14" the output of your formula is 3 whereas is should be 2 (Smith, John and Goldberg, Jane). your formula counts Goldberg Jane twice.

    Any thoughts?

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding unique combinations across 3 columns using a function

    The Pivot is associated with the table so no need of manual adjustment of ranges in case of any increase or decrease in data size.

    You just needed to place the cursor inside the pivot and do right click and select refresh to see the updated results.

  11. #11
    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: Finding unique combinations across 3 columns using a function

    This one? ...............



    Of course i agree that Pivot Table is better solution...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Finding unique combinations across 3 columns using a function

    Fotis, I think this may just work actually!! thank you so much!

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Finding unique combinations across 3 columns using a function

    See if this workbook helps.

    Select from the dropdown in E2

    Two option are given
    Columns G:I list all records for the selected person, K:M list unique records.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  14. #14
    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: Finding unique combinations across 3 columns using a function

    Quote Originally Posted by Hdim View Post
    Fotis, I think this may just work actually!! thank you so much!
    .....................

+ 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