+ Reply to Thread
Results 1 to 14 of 14

Excel Macro to find unique distinct value based on Criteria

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Nairibi, kenya
    MS-Off Ver
    Excel 2010
    Posts
    6

    Excel Macro to find unique distinct value based on Criteria

    hi

    I am currently using following macro which I found from forum (thanks), however now I would like to collect information if column B value is equal to "Europe"

    Please Login or Register  to view this content.
    Answer should be in Dropdown list

    Please help me

    _____
    data column C

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 12-20-2014 at 08:42 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Excel Macro to find unique distinct value based on Criteria

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    12-31-2012
    Location
    Nairibi, kenya
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Excel Macro to find unique distinct value based on Criteria

    Thank you very much for taking time to review, I have attached a sheet of data and requirement (before and After), the macro has no implication on the data, it should extract distinct unique information (preferably alpha sort) in a separate summary sheet, which enables to make summary sheets on unique item. Currently I am using excel array formula to get this information but it has slow down the worksheet, as the number of records are more than 300,000.
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Excel Macro to find unique distinct value based on Criteria

    See the attached,
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by davesexcel; 12-20-2014 at 09:11 PM.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Excel Macro to find unique distinct value based on Criteria

    Hello Amir,

    I've restored this thread to normal and modified your post #1 to be forum-rules compliant. I know you're new, and let me say welcome.

    But do take a moment to read and understand the forum rules, the link is above in the menu bar. We all abide these rules for everyone's overall benefit, as must you. Note particularly rules #1 and #3, they are the most common broken by newcomers.

    (hat-tip)
    Last edited by JBeaucaire; 12-20-2014 at 08:56 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Excel Macro to find unique distinct value based on Criteria

    What's up man!
    Last edited by davesexcel; 12-27-2014 at 08:32 AM.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Excel Macro to find unique distinct value based on Criteria

    Just done a similar problem
    http://www.excelforum.com/excel-prog...down-list.html
    Attached Files Attached Files
    Last edited by jindon; 12-20-2014 at 10:18 PM. Reason: Attachment revised

  8. #8
    Registered User
    Join Date
    12-31-2012
    Location
    Nairibi, kenya
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Excel Macro to find unique distinct value based on Criteria

    Dear Gurus / Friends

    The solution seem fine to me, however when I used the macro with my real data, it does not give the desired results, as I explan the data is very Dynamic the regions can increase or decrease same is with other columns data. for this specific reason I am using above code (VB code on top). What I need an array forumla which can extrat unique distinct information from my data of any Column based on criteria like ABC[country]. Same feature we use in Pivot table, if I select Country "SOM" it filters all info related to SOM, but this information is unique, so the macro should copy code "120130" and 120131 in a column "summary" sheet. So I can use sumifs function to get the financial information.
    summary.JPG

    Sorry If I was not very clear

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Excel Macro to find unique distinct value based on Criteria

    Who are you talking to?

    Posting picture doesn't help at all anyway.

  10. #10
    Registered User
    Join Date
    12-31-2012
    Location
    Nairibi, kenya
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Excel Macro to find unique distinct value based on Criteria

    jindon

    The Macro you shared was really good, as I explained, I like to have some thing really dynamic, what I wnat is to have a macro which can extract unique information from hundread of thousand rows based on one to two critetia.

    I know for you guys its simple but I was truggling to modify code which i share earlier

    thank you

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Excel Macro to find unique distinct value based on Criteria

    What you are asking is too abstract.

  12. #12
    Registered User
    Join Date
    12-31-2012
    Location
    Nairibi, kenya
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Excel Macro to find unique distinct value based on Criteria

    I am really sorry I wasted your time, just a last attempt

    I have attached data table with desired results and my logic to obtain that result. With additional explanation of my data.

    Thank you in advance for all your patience. I have improved my skills from looking many examples through this forum, and keep posting it It really helps the masses.
    Attached Files Attached Files

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Excel Macro to find unique distinct value based on Criteria

    You can filter the data then do whatever you want with , check out the attached example..

    Change A2 to get the list for B2, then select B2 to get the filtered data.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    12-31-2012
    Location
    Nairibi, kenya
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Excel Macro to find unique distinct value based on Criteria

    thanks for the help, this is very usefull

+ 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] Create a distinct list based on other criteria
    By tomtheappraiser in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-29-2014, 12:59 PM
  2. Replies: 5
    Last Post: 03-13-2012, 06:05 AM
  3. Pivot Tables-To Find Count of Unique(Distinct)User id within the same Journal Entry.
    By Deepthik in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2010, 06:09 AM

Tags for this Thread

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