+ Reply to Thread
Results 1 to 23 of 23

Removing duplicates from value

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Removing duplicates from value

    Hello
    Is there a way to remove duplicates from formula outcome. I use concatifs function, but it lists a warehouse name every time the criteria matches, but one mention would be enough.

    The formula I use:
    HTML Code: 

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Removing duplicates from value

    Hi Kalts,

    ConcatIfs appear to be a UDF .. could you upload your excel workbook to enable forum members to have more clarity on this query. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Here's my sample.test.xlsx

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Removing duplicates from value

    Just guessing (because I'm not sure what result you want) but maybe this in G9:

    =IF(COUNTIF(E$4:E8,E9),"",ConcatIfs(",",$A$3:$A$9,$B$3:$B$9,E9,$C$3:$C$9,F9))

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Hi Cutter!
    Thanks for your reply. The formula you provided is not exactly woring for me. I'll try to explain once more.
    There are multiple outcomes with concatif formula in cell G8. I want only unique warehouse names appeared in G column. I need to see in which warehouse the item is situated. Items may be in different warehouses and I only need to know one warehouse name, but now it shows me warehouse name every time the criterias match, like in cell G8 where there are two occurances of warehouse 1.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Removing duplicates from value

    As Dilipandey said, your Concatifs function is a UDF (User Defined Function). We can't do anything about the results of a UDF without seeing the source code for it. I, myself, won't be able to help you with it.

  7. #7
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    UDF-s source code is here.

    Please Login or Register  to view this content.

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    try

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  9. #9
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Hello Andy, thanks for reply! How can I change the name of the function? I tried concatifs2, but then it generates "compile error: argument not optional"

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Removing duplicates from value

    If you mean changing the name of the function that Andy provided then you have adjust the function name he used. So something like:

    Please Login or Register  to view this content.
    instead of

    Please Login or Register  to view this content.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  11. #11
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Yes, I tried that but then I got the error. And all the top part of formula was marked yellow

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    You would not only need to change the function signature but all references to the function variable within the routine.

    Attached includes both orignal and revised functions
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Hello Andy! Your solution seems to be working very well in the sample document. Only problem is that I cannot get it started in my document. I keep on getting "Argument not optional" error. What should I do?
    Should I place your funtion on top of the concatifs functions like in the sample page or what?

  14. #14
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    You should just have been able to replace existing function with revised one.

    It's not clear what you have done that is causing the Error. You would need to post a file so we can see.

  15. #15
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    I copied your function and created a new module.

  16. #16
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    Then that would have given you a duplicate function name issue rather than Arguments not optional. Assuming you did not delete you original function.

    You know the code works as you have tested the example. So it can only be something you did in preparing your actual workbook, unfortunately we can not see that nor did we see what you actually did. Hard to diagnose this remotely.

  17. #17
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    How can you take a look what I'm doing wrong? I don't want to load up my worksheet because it contains too much classified information.

  18. #18
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    We can't 'take a look' that's the problem. All we can do is describe what you need to do, which was to simply replace your existing code with the new version.

    Or you could edit your existing code and add the new INSTR test.

  19. #19
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Ok, I tried to create same function in the sample document and it generates same Compile error:Argument not optional.

  20. #20
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    Then post that file so we can see and investigate the error.

  21. #21
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    Here you go.

    832534_2.xlsm

  22. #22
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Removing duplicates from value

    Your ConcatIfs2 function contains referances to the function ConcatIfs.
    This is in fact an error as you do not want to call the ConcatIfs function but to continue appending text to the ConcatIfs2 variable.


    Looks like you copied my first code posting then altered the function name without reading or doing what I suggested you would need to do in post #12.

    You would not only need to change the function signature but all references to the function variable within the routine.

  23. #23
    Registered User
    Join Date
    05-17-2012
    Location
    Estonia
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Removing duplicates from value

    I got it working! Thank you very much for your help Andy!

+ 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