+ Reply to Thread
Results 1 to 28 of 28

INDEX MATCH SMALL but ignore duplicates

  1. #1
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    INDEX MATCH SMALL but ignore duplicates

    Hi,

    I am trying to lookup one of two values from Sheet2 cells M2 or N2 in column C of sheet1 and then return what is in column A. My issue is that column A will have duplicates and I only one to bring through unique values. I have the following formula that seems to work but you will see on Sheet2 of the attached example it brings through duplicates in columns B to G of Sheet2.

    =IFERROR(INDEX(Sheet1!$A$2:$A$14,SMALL(IF(($M2=Sheet1!$C$2:$C$14)+($N2=Sheet1!$C$2:$C$14),ROW(Sheet1!$F$2:$F$14)-ROW(Sheet1!$F$2)+1),COLUMN(A1))),"")

    I have put the expected result on Sheet2 which just shows one entry per lookup.

    Thanks

    Paul
    Attached Files Attached Files
    Last edited by pareid; 07-12-2019 at 02:43 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    No need for an array-entered formula:

    =IFERROR(INDEX(Sheet1!$A:$A,AGGREGATE(15,6,ROW(Sheet1!$F$2:$F$14)/((($M2=Sheet1!$C$2:$C$14)+($N2=Sheet1!$C$2:$C$14))*(COUNTIF($A2:A2, Sheet1!$A$2:$A$14)=0)),1)),"")

    copied across and down.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Thank you so much Glenn for your reply and help.

    That works great in my example worksheet but when I put it into my master spreadsheet that has a lot of data it just returns zeros. I have adapted the obvious parts of the formula e.g. changed the $14 to $5000 to take account of the extra rows. Is there anything else I would need to change e.g. in the AGGREGATE statement.

    Because I cut my example spreadsheet down for simplicity I have shown the formula when I put it into my master spreadsheet. Sheet1 is called (CopiedFUM). It just has some more columns and rows.

    =IFERROR(INDEX(CopiedFUM!$B:$B,AGGREGATE(15,6,ROW(CopiedFUM!$AX$2:$AX$6000)/((($AD2=CopiedFUM!$G$2:$G$6000)+($BU2=CopiedFUM!$G$2:$G$6000))*(COUNTIF($A2:A2, CopiedFUM!$B$2:$B$6000)=0)),1)),"")

    Thanks again for your help.

    Regards

    Paul

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    What cell have you put the formula in?

  5. #5
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    Its in E2 and then copied across and down.

    Thanks

    Paul

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    =IFERROR(IF($AD2="","",INDEX(CopiedFUM!$B:$B,AGGREGATE(15,6,ROW(CopiedFUM!$AX$2:$AX$6000)/((($AD2=CopiedFUM!$G$2:$G$6000)+($BU2=CopiedFUM!$G$2:$G$6000))*(COUNTIF($E2:E2, CopiedFUM!$B$2:$B$6000)=0)),1))),"")

    The required fix, and a correction.

  7. #7
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    I am getting zeros returned so I have done another example file that has all the columns in it and I have deleted any sensitive data and just left the fields populated that the formula looks at. I thought this might be easier for you to look at but I am struggling to upload it to the site. The formula is in cell E2 in the 'DFM L T Bronze Removed' worksheet. I will keep trying to upload it for you.

    Thanks

    Paul

  8. #8
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    It does say I have circular references in the formula.

    Thanks

    Paul

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    Save it as an .xlsb or zip it. File size limits are bigger

  10. #10
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Here you go Glenn,

    Thanks

    Paul
    Attached Files Attached Files

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    My mistake..

    Try:

    =IFERROR(IF($AD2="","",INDEX(CopiedFUM!$B:$B,AGGREGATE(15,6,ROW(CopiedFUM!$AX$2:$AX$6000)/((($AD2=CopiedFUM!$G$2:$G$6000)+($BU2=CopiedFUM!$G$2:$G$6000))*(COUNTIF($D2:D2, CopiedFUM!$B$2:$B$6000)=0)),1))),"")

    Row 2 is blank as there is no exact match from the AD2/BU2 cells.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Thanks Glenn,

    That looks like it has worked. I will carry on looking through the data and see if I notice anything not quite right but looks great so far.

    Appreciate all the help

    Regards

    Paul

  13. #13
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    that does look like its working great. Just a quick question. Do you know if I wanted to also bring through the corresponding value in column S of the copiedFUM worksheet i.e. I bring through column B and the corresponding value in column S, is that possible?

    Thanks

    Paul

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    Your description is ambiguous.

    Bring through... in the same cell, or in another one?

    For each company, will there be one plan number, or several. If several, what results do you want to see.

    Please modify your sample sheet and post it in a new post on this threead.

  15. #15
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    Yes sorry, it is a bit ambiguous. There may be more than one plan number per company but happy for it to be in the same cell e.g. SIS 10043567 400787637, so you only have one cell per company still but could have multiple plan numbers separated with a space

    I hope that makes sense.

    Thanks

    Paul

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    That may need VBA... Is that possible?

  17. #17
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    Yes VBA is possible if that's the best way to go.

    Thanks

    Paul

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    Unfortunately, I'm no good with VBA. I had one option up my sleeve, but it didn't work. I'll ruminate on this for a little longer...

  19. #19
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    No problem, thanks again.

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    Another senior moment. DO NOT copy this into your real sheet yet. Check it out on this one first. Let me know if it's what you want.

    It's an array formula. Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    Enable macros on opening.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    Yes that looks perfect.

    Thank you.

    Regards

    Paul

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    Woo Hoo!!You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  23. #23
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    When transferring to your real sheet... copy the code in module 1 to a module your real sheet and save as xlsm.

  24. #24
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Hi Glenn,

    I hope you are well. I hope you don't mind me asking a quick question regarding the VBA code you helped me with recently. It has been brilliant and working really well. I just wanted to ask you whether it was possible/easy to amend the code so that it also brings through column C from the 'CopiedFUM' tab? As an example I have attached the same example spreadsheet you created for me and put a highlighted section on the 'DFM L T Bronze Removed' tab.

    In essence I am just trying to append the data in 'CopiedFUM' column C to the end of the plan number.

    Thanks

    Paul
    Attached Files Attached Files

  25. #25
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,848

    Re: INDEX MATCH SMALL but ignore duplicates

    The thread is marked as solved - you might wish to change this for now.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  26. #26
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    Yes.... and it was easier than I'd feared!!

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  27. #27
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: INDEX MATCH SMALL but ignore duplicates

    Thank you Glenn, that is absolutely perfect.

    Really appreciate it.

    Cheers

    Paul

  28. #28
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: INDEX MATCH SMALL but ignore duplicates

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Match, Index, duplicates
    By sul3726 in forum Excel General
    Replies: 6
    Last Post: 03-01-2017, 04:59 PM
  2. Index match with duplicates
    By harikammula in forum Excel General
    Replies: 3
    Last Post: 09-30-2015, 09:13 AM
  3. Index/Match ignoring Blanks/Zeros for each instance
    By corhrtz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2015, 11:04 AM
  4. [SOLVED] INDEX/MATCH with duplicates add up
    By joshbcs2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-10-2014, 10:23 AM
  5. [SOLVED] INDEX - MATCH with duplicates
    By ellis0179 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2013, 02:04 AM
  6. Replies: 2
    Last Post: 03-16-2012, 12:03 PM
  7. Index Match Duplicates
    By scooby99 in forum Excel General
    Replies: 5
    Last Post: 12-30-2011, 01:48 PM

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