+ Reply to Thread
Results 1 to 24 of 24

Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

  1. #1
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Excel 2010 - Modify formulas to find duplicate and unique values with alphanumeric data

    Can someone please give me a hand.

    I have a workbook that identifies all duplicate and unique rows, while labeling as a "set" those rows that match together. This solution uses helping columns.


    The way it works is as follows:

    1. I paste in column A numeric data which is separated by commas. For example: 4, 2, 8, 1
    2. The formulas in place in columns C through Q extract into themselves the comma separated data from column A, into their own individual cells.
    3. Then, column R has formulas that use helping columns with formulas (AG:AV) to identify which ROWS contain the same data regardless of the order withing the row, and then it shows on screen either "Unique" or "Duplicate Set 1" or "Duplicate Set 11" to indicate the rows that match one another.


    Everything works correctly, except that it only works with numbers but it will not work with alphanumeric data.

    I need this existing solution to work with alphanumeric data, instead of just numbers.


    Please see attached file "Excel 2010 Find Duplicates v1". This file already has numeric data in column A to show how it works. Again, everything works fine here, as long as the data is numbers separated by commas.

    Please see attached file "Excel 2010 Find Duplicates v2". This file has the ALPHANUMERIC data in place in column A but nothing is happening. I need this v2 file to work like V1.


    By the way, the solution is to be done with formulas... but I would also love to see it done with VBA, if possible. I think then the helping columns would not be needed.



    In advanced, thank you so much for any help provided.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    You can use this to separate the values into columns C:Q

    =IFERROR(TRIM(MID(SUBSTITUTE($A1,", ",REPT(" ",LEN($A1))),(COLUMN(A$1)-1)*LEN($A1)+1,LEN($A1))),"")

    Not sure how that's going to work with the SMALL function. Maybe convert and concatenate the CHAR code for each letter to a number.

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


    will convert BG12 to 667112.

    So maybe another set of helper columns will be required.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I have run out of time for a while so ended up making the below quite crude, the code below was made to work with the data you have in 'Sheet2':

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If things don't change they stay the same

  4. #4
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    TMS,

    Your formula does extract he alphanumeric values correctly, but then the formulas in column R (and the corresponding helper columns) now show #Num! and it can't find the duplicate or unique values Your suspicion was spot on, and I have a feeling that your suggestion on how to deal with the SMALL helper columns will do, but it's a little beyond me. I will work on it though. I'll follow your suggestion. Thank you.


    CheeseSandwich,

    Crude or not, your VBA solution does exactly what I need. I'll switch to that "crude" format. The results are what matter. Actually, you wrote the code in such a way that I am able to use it in the main sheet by simply changing the cell references in the code. Thank you.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    You're welcome. Thanks for the rep.



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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Hello TMS, yes I am aware of the "star icon". You actually said "Thanks for the rep." which means I did use that icon. I think it's an automated reply you have there, right? I will mark this thread solved when I get home after I troubleshoot/work a little with your formula suggestion. Thanks.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I think it's an automated reply you have there, right?
    Yep. It's actually two standard messages. The first to thank you for the rep, so thanks again. And the other that asks you to mark the thread as solved, assuming that it is. The second part of that message is to encourage OPs to consider all contributors regardless of how effective the suggestion/solution was. If you've already done it, that's great; if not, it's a prompt to do it. If I'd seen a reply from CheeseSandwich, I would probably have removed the second part. Hope that helps.

  8. #8
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Yes, it helps... and yes, I also gave him a rep... but he could be asleep at the moment and has not seen it. I always give rep to every one, no effort goes unnoticed with me.

    I'm starting to drive home now, it's about two hour drive. I'll try later to follow your formula suggestion. I hope I can implementing using extra helping columns.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I always give rep to every one, no effort goes unnoticed with me.
    Thank you for that. You would be surprised how many people don't give rep, or even say thank you ... and sometimes disappear, never to be heard from again. And that can be after a lot of time and effort.

    Rep isn't everything but it is a measure of your effectiveness, and it is very much appreciated.

    but he could be asleep at the moment and has not seen it.
    That would be early to bed, but not impossible. It's only 8:15 pm here.
    Last edited by TMS; 05-15-2024 at 03:16 PM.

  10. #10
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I am still awake... Just been on dad duty.

    Thanks for the rep.

    I might get time to refine the code tomorrow, unless the VBA solution is not really needed?

  11. #11
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    "Dad duty"... oh those days. Soon it will be the "Grandpa duty" days. Time passes way too fast. BUT IT'S AWESOME. It's what life is about... that and chess, and soccer, and pizza, and coding.


    The real sheet has other formulas that point to the range C:Q and it does other computation with the extracted data. There is no extracted data to the C:Q range when using the VBA option... but it does exactly what I need on its own.

    If the VBA code you wrote can be made to fit directly onto the Sheet1 (on the existing layout structure), say columns A and B to be used as they are now in the code you wrote (not touching the C:Q range), and then column R to label "Duplicate set x" and columns V and W starting at row 22 and below for the count which and how many repeat, that would be awesome. Then I will use the formula provided by TMS to extract the data from A onto C:Q and since the VBA will not touch that range, then all will be good, perfect actually.

    Thanks you so much for helping me.
    Last edited by Luisftv; 05-15-2024 at 06:03 PM.

  12. #12
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I noticed that you have used '@INDEX' in one of your formulas. What version of Excel are you using this in (What version does it need to work in)?

  13. #13
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Excel 2010. It needs to work in this version.

    Can the VBA code you wrote be modified so that instead of using column c (to show if Unique or Duplicate set X) it would use column R, and then the count located in E1 and F1 to be placed instead on V33 and W33 and below, respectively?

  14. #14
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,182

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    You've posted in the formulas section, but now seem to want VBA - shall I move the thread for you?
    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.

  15. #15
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    It depends... if the VBA gets adjusted to my existing layout, then it's a winner. Or if the formulas get to work, then that is that. I honestly think that I will use both. The TMS formula solves half my problem (it extracts the alphanumeric data in one cell into multiple cells), and the VBA does the other half where it finds the duplicate and the unique values and it counts it. Right now I'm trying to modify the VBA so that the results go into specific columns but I'm stuck... I can't move column C.

    Also, I did posted in the formula section because originally I was trying to adjust the existing formulas I have, but it may be more troublesome...
    Last edited by Luisftv; 05-16-2024 at 03:30 AM.

  16. #16
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Quote Originally Posted by Luisftv View Post
    I can't move column C
    With the above in mind, does this mean you can't sort the range C:Q?

  17. #17
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Maybe the below layout will be better?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Wow... yes. I only need the following modifications. I've been trying to do it but I make a mess each time.
    • The data must start at row 1... no headers in the rage A:W
    • Move the "Sorted and joined" output column R to column B
    • Move the "Duplicate" output column (where you read "Unique" or "Duplicate Set x") from column S to column R
    • Column S must be empty. That column is being used for a different purpose already
    • Range C:Q is where the data gets spitted onto - and it can be sorted or not (sorted is better)
    • The output in Z and AA is perfect there (I love the headers you put there)
    • I also love the Drop-Down box you placed in V3, but since there are no headers in that column either, I has to be in V2 (jajaja that I was able to move)


    Like this:

    01.png
    02.png
    03.png


    Please see attached workbook. I simply copy/pasted the data to make it look as it is desired. I am still trying to modify the VBA myself (the attached workbook here has your code untouched by me). The "Offset(, 2)" (for example) is what I still don't quite understand.


    This is as far as I got, and I hope I'm not so far off (I still need to make your awesome drop down box work), and I'm not sure about the part in red, maybe I got it right, but the pull down on V2 does not highlight anything (the one you made):

    Please Login or Register  to view this content.
    Last edited by Luisftv; 05-16-2024 at 05:00 PM.

  19. #19
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I think I got it.

    I had forgotten to view/change the cell references in column W.

    Now everything works as needed. It's awesome. Super awesome. Everything works, the pull down you added, the highlighting, etc.

    Can you please confirm that the changes I made to the VBA code are correct? I don't want to loose data inadvertently.

    I'm attaching the workbook here too.

    Here is the code with my tiny modifications (just so that the output would be moved to the needed columns). The blue color indicates where I have doubts of what I did. That "Z2:Z" is followed on the next line by "Z1:Z". I don't understand yet why that second line has to be Z1, otherwise it makes a duplicate in the Z column. But everything seems to work as expected though.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Luisftv; 05-16-2024 at 07:11 PM.

  20. #20
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I found only one mionor glitch so far.

    Using VBA, part of the process requires to clear the previous content, so...

    To clear the ranges, the code has:

    Range("Z2:Z" & lRow).ClearContents
    Range("AA2:AA" & lRow).ClearContents

    or

    'Range("Z2:Z" & Range("Z" & Rows.Count).End(xlUp).Row).Value = ""
    'Range("AA2:AA" & Range("AA" & Rows.Count).End(xlUp).Row).Value = ""

    or

    'Range("Z2:Z" & Range("Z" & Rows.Count).End(xlUp).Row).ClearContents
    'Range("AA2:AA" & Range("AA" & Rows.Count).End(xlUp).Row).ClearContents


    Obviously, the first time I clear the ranges it will work fine, but on the second time it will keep going UP... and erase the column headers.

    What can I do to make it stop at row 2 while still using this ".End(xlUp).Row" manner? That way the headers in row 1 won't be deleted.

    I like using that ".End(xlUp).Row" manner because it will always clear all the way down finding the last row with data automatically, regardless if now I have ten rows and later a thousand.

    I know that doing it the following way will work, but it imposes a limitation (a fixed range):

    Range("Z2:Z93").ClearContents

    Any ideas?

  21. #21
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    I don't know if this is the correct way of doing it, but is working:

    Please Login or Register  to view this content.

    With that, now it leaves alone the first row on columns Z and AA. This solution probably is really crude.
    Last edited by Luisftv; 05-17-2024 at 02:01 AM.

  22. #22
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    Try:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by CheeseSandwich; 05-17-2024 at 02:45 AM.

  23. #23
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    221

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    CheeseSandwich,


    It works flawlessly. Thank you so much.

    I had forgotten to add a "ClearContents" to the "Paste from Clipboard" sub (which is unrelated to your VBA solution). So, I'm attaching the final working file for reference (and includes what I had forgotten).

    Have a wonderful day and THANK YOU once again.
    Attached Files Attached Files
    Last edited by Luisftv; 05-17-2024 at 03:32 AM.

  24. #24
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2405-17628.20102
    Posts
    1,393

    Re: Excel 2010 - Adapt formulas to find duplicate and unique values with alphanumeric data

    You are very welcome, glad you have what you need.

+ 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] Give Duplicate Alphanumeric Values a Unique Identifier
    By papgar in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-18-2018, 10:45 AM
  2. [SOLVED] Find count of Unique or Duplicate Values based on Concatenated values in 2 columns
    By bdicarlo1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-03-2014, 12:42 AM
  3. [SOLVED] Find duplicate alphanumeric values in two different worksheet
    By Habs21 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-10-2014, 01:15 PM
  4. Find duplicate values for unique column
    By zammy73 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2014, 06:45 PM
  5. Replies: 1
    Last Post: 01-22-2013, 07:02 AM
  6. [SOLVED] How to find duplicate values from two sets of data in excel 2010
    By ratu4110 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-30-2012, 04:07 PM
  7. [SOLVED] Find unique duplicate values in rows
    By Bay in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-03-2011, 10:52 AM

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