+ Reply to Thread
Results 1 to 20 of 20

Conditional Formatting - Duplicates, any order?

  1. #1
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Conditional Formatting - Duplicates, any order?

    Hi, I'm a beginner to Excel 2010, I use the compare feature which is helpful, however it doesn't compare the same digits if they are in a different order within each cells. Is there a way to compare two columns and show if cells match in values regardless of their order and show the quantity matched?

    For example, for column [labeled X] 120 values, compare this to column [labeled Y] 114 values. I searched as much as possible, however I'm a bit confused how to approach this, can someone help me?

    I would also like to do this for 4 digits as well.

    5-28-2016 2-36-59 AM.jpg
    Attached Files Attached Files
    Last edited by glowtraq; 05-29-2016 at 06:18 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Conditional Formatting - Duplicates, any order?

    Need to separate numbers so if only 3 numbers this could be solution:

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


    Edit: Confirmed with ctrl+shift+enter.

    Then use CF in this Column
    Last edited by zbor; 05-28-2016 at 12:13 PM.

  3. #3
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    Thank you, when you say separate, do you mean to take column x or y and split it up using "Text to Columns"?

    I'm sorry, I'm very new to this, what do you mean by Confirmed with ctrl+****+enter? For some reason I have to always format the cells as text when I copy them into Excel, will this affect the formulas?

    For the formula you posted, I tried this on column B, however it doesn't seem to be yielding the correct results.

    5-28-2016 12-07-02 PM.jpg

  4. #4
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    Ok, so I tried splitting up the first column and values did appear in the column with the formula, however they don't seem to be accurate.

    5-28-2016 12-11-25 PM.jpg 5-28-2016 12-14-27 PM.jpg
    Last edited by glowtraq; 05-28-2016 at 12:15 PM.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Conditional Formatting - Duplicates, any order?

    LoL, sorry...
    I made typo so instead of shift it was autocorrected.

    It should be CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer, like now.

    Here is attached workbook.

    Also, 024 should give result 3 because you have 042 in cell C76.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    zbor thank you, you're awesome! I'm going to test this out a bit more. If I wanted to compare 4 digits in column x against 4 digits in column y, would the formula have to be adjusted?

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Conditional Formatting - Duplicates, any order?

    Just add one more criteria:

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

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting - Duplicates, any order?

    This appears to work. What I have done is to take each 3 digit number in column A and put them in all the different orders other than the starting order and search for them in column C.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The values in column C that match your example of 024 in column A in column C are: 204, 402, 042.
    Attached Files Attached Files
    Last edited by newdoverman; 05-28-2016 at 04:00 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  9. #9
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    Thank you NDM and zbor, I noticed something strange in the formulas for both sheets with the 3 digit numbers - I tried to replace the values in column A with a new set of 3 digit numbers, which seems to break the count. The difference with the new 3 digit numbers is that they contain double digits.

    Examples of digits with double numbers

    001
    002
    003
    004
    005
    006
    007
    008
    009
    011
    022
    033
    044
    055
    066
    077
    088
    099
    112
    113
    114
    115
    116
    Attached Files Attached Files
    Last edited by glowtraq; 05-28-2016 at 05:32 PM.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting - Duplicates, any order?

    This appears to work. It compares the 3 digits in column A cells with each other and if there is a match (double) then the count is divided by 2.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Conditional Formatting - Duplicates, any order?

    Another approach in attachment.

    It's complicated but I found difference in case all 3 numbers are same.
    I think mine should work so newdoverman please check.
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Conditional Formatting - Duplicates, any order?

    Or try this ...

    =IF(MOD(A2,111)=0,COUNTIF($C$2:$C$115,A2),SUMPRODUCT((ISNUMBER(SEARCH(MID(A2,1,1),$C$2:$C$115)+SEARCH(MID(A2,2,1),$C$2:$C$115)+SEARCH(MID(A2,3,1),$C$2:$C$115)))*(MID(A2,1,1)+MID(A2,2,1)+MID(A2,3,1)=MID($C$2:$C$115,1,1)+MID($C$2:$C$115,2,1)+MID($C$2:$C$115,3,1)))) .
    Last edited by Phuocam; 05-29-2016 at 05:29 AM.

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting - Duplicates, any order?

    For 3 identical digits forming a number, this should do it.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The check for contents in column A is necessary because the values in column C extending past the last value in column A have already been counted.
    Last edited by newdoverman; 05-29-2016 at 09:22 AM.

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting - Duplicates, any order?

    @zbor
    I amended my formula to accommodate 3 identical digits in the number and the results are identical to your results. Here is your workbook with the side by side comparison.
    Attached Files Attached Files
    Last edited by newdoverman; 05-29-2016 at 09:49 AM.

  15. #15
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    zbor, I was testing the formula for 4 digit numbers, however when I pasted the static data into column A and the non static data into column c, the count results appeared off.
    Attached Files Attached Files

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting - Duplicates, any order?

    Seeing that the requirements for this are constantly changing, I'm out.

  17. #17
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    My apologies ndm, I should've updated the requirements, zbor did post a formula for 4 digits yesterday, I should've tested it earlier. In a nutshell, I'm looking for variations in 4 digits and 3 digits only. The amount of digits will not go past this.

  18. #18
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting - Duplicates, any order?

    No apologies necessary. I think zbor is probably onto the best solution technique.

  19. #19
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Conditional Formatting - Duplicates, any order?

    Try again ...

    =SUMPRODUCT((ISNUMBER(SEARCH(MID(A2,1,1),$C$2:$C$115)+SEARCH(MID(A2,2,1),$C$2:$C$115)+SEARCH(MID(A2,3,1),$C$2:$C$115)+SEARCH(MID(A2,4,1),$C$2:$C$115)))
    *ISNUMBER(SEARCH(MID($C$2:$C$115,1,1),A2)+SEARCH(MID($C$2:$C$115,2,1),A2)+SEARCH(MID($C$2:$C$115,3,1),A2)+SEARCH(MID($C$2:$C$115,4,1),A2))
    *(MID(A2,1,1)+MID(A2,2,1)+MID(A2,3,1)+MID(A2,4,1)=MID($C$2:$C$115,1,1)+MID($C$2:$C$115,2,1)+MID($C$2:$C$115,3,1)+MID($C$2:$C$115,4,1)))

  20. #20
    Registered User
    Join Date
    05-28-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    15

    Re: Conditional Formatting - Duplicates, any order?

    Hi guys, thanks for helping me with this, sorry I have been away. I'm still trying to fix the workbook with 4 digits matching numbers to work, can't seem to. Phuocam, I tried your formula however it's not working, for example, matching digits 0148 shows a match of 2 times, however this is not the case in column c. I've attached the sheet with Phuocam's formula. Also each time I tried to extend the column search depth to 200 from 115, the formula breaks.

    I've attached my workbook, can someone help me with this?
    Attached Files Attached Files

+ 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] Three-way Conditional Formatting for Duplicates?
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2011, 05:34 AM
  2. Duplicates Conditional Formatting
    By jayclinton in forum Excel General
    Replies: 4
    Last Post: 12-20-2010, 07:41 PM
  3. Excel 2007 : Conditional Formatting Order
    By jollywood in forum Excel General
    Replies: 6
    Last Post: 10-26-2010, 11:10 AM
  4. conditional formatting / add duplicates
    By infinitysales in forum Excel General
    Replies: 12
    Last Post: 07-10-2009, 06:31 PM
  5. Conditional Formatting/Duplicates
    By vba-dev in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-21-2009, 04:19 PM
  6. help with conditional formatting duplicates
    By novice2430 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2008, 03:21 PM
  7. conditional formatting for duplicates
    By zachg in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-04-2007, 04:26 PM
  8. Duplicates through conditional formatting
    By JonPugh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-03-2007, 06:36 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