+ Reply to Thread
Results 1 to 18 of 18

Conditional formatting - Highlight duplicates Only when len > 4

  1. #1
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Conditional formatting - Highlight duplicates Only when len > 4

    Hi,
    searched the forum but couldn't find an answer.
    I would like conditional formatting to highlight duplicate values in column C, only when cell value is over 4 characters.

    Your assistance is appreciated.

    thanks
    Ziv
    Last edited by Zivhodiva; 10-15-2020 at 12:58 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Maybe

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


    Change the C1:C10 range as necessary
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Thank you for your reply,
    2 issues:
    1 - it gives false duplicates for long strings of texts/numbers (I'm using for USPS/UPS tracking numbers and those are typically 18 to 22 characters long)
    2 - How can I apply it to the entire column (or for the first 2000 raws) without using the Format brush? (when I use the format brush is removes existing formatting from cells that have existing specific formats, all these cells (that have existing formatting) are 4 characters or less)

    thanks
    Last edited by Zivhodiva; 10-07-2020 at 09:20 PM.

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,824

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Please see the yellow banner at the top of the page. It is much easier to help with a sample file.

  5. #5
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Attached sample file
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Would you clarify please.

    Your OP said you wanted to highlight duplicates where the cell value in column C is >4 characters.

    It seems from the cells you've coloured that you mean <4 characters

  7. #7
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Thanks again for your reply.
    My OP is correct.
    I can clarify that the reason I need to highlight cells with >4 is because cells <4 already have specific color formatting that i do not want to be changed by the conditional formatting rule.

    thanks

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    So your OP wasn't quite correct. You said nothing about needing to retain any manual painted cells.

    Here's a CF I worked on earlier. Put it in C3 and copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It doesn't retain the manually painted cells in all circumstances.
    We'd need to know what the rules are for manually painting the cells in order to do that.
    I suspect your production workbook might have additional stuff which would help. If not then it may be that a macro is necessary.

  9. #9
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Hi,
    thanks
    - How do I "copy down" the conditional formatting formula? I created a conditional formatting rule with your formula for cell C3, then tried to use the Formatting brush to copy it down the column, but the formula cell value remains "C3" even on lower rows.
    - regarding the cells that have a different background color. all these cells are <4 characters. the background color is set manually (not via a formula or conditional formatting)

    thanks again

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    The brush only copies the manual formatting. It won't copy a CF

    Either copy the formula down or when you first create the CF in C3 use the 'Applies To' box and enter the C3:Cnn range to which you want the CF applied.

  11. #11
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Hi,
    I tried to apply the formula as you explained (please see attached new "sample".xls)
    The formula (or the way I apply it) does Not find duplicates for cells >4
    it does find duplicates of cells <4. by "finding" the duplicates of these cells it also changes their formatting.

    any idea?

    thanks
    Attached Files Attached Files

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    But your original post mentioned values greater than 4.
    When you presented a workbook showing what you wanted it seemed you wanted matches where the values were less than 4.

    You now appear to be saying that the length of the text strings is irrelevant. In which case just leave out the IF which tests for the length of the string. i.e.

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

  13. #13
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    "But your original post mentioned values greater than 4." - Yes, that is what I wrote and what I need.
    "When you presented a workbook showing what you wanted it seemed you wanted matches where the values were less than 4." - The workbook only showed that cells <4 have manual background color formatting.
    I did not mean to imply that I need to find duplicates for cells <4.

    As I wrote in my OP, I need to find duplicates for cells >4 (noting that these cells have relatively long text/numbers strings usually unto 22 characters).
    cells with <4 formatting should not be affected (i.e they'll keep their manual background color formatting).

    thanks

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    I feel that the following modification of Richard's formula from post #2 will do what you want:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  15. #15
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Hi,
    thank you for your assistance,
    I tried your (JeteMc) formula. result in attached .xlsx
    - it did Not identify the duplicate (C29 & C44)
    - it was able to "skip" most of the <4 cells as I need, but seem to fail at that when there are more than 2 duplicates (failed to "skip" for C27, C42).

    thanks

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Sorry about that.
    Try the following: =AND(LEN(C2)>4,SUMPRODUCT(--($C$2:$C$49=C2))>1)
    The above rule should be applied to =$C$2:$C$49
    When I tested on the file only cells C29 and C44 were highlighted light red fill with red font.
    Let us know if you have any questions.

  17. #17
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    Thank you,
    its works perfectly

    I don't understand how come the last formula works, while the one before doesn't, as they're essentially the same formula, one with "C4", the other with "C2", but the same other than that.

    thanks again.

  18. #18
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: Conditional formatting - Highlight duplicates Only when len > 4

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'.
    It was important to change the references in the formula from C4 to C2 because the Applies to range starts with cell C2 i.e. =$C$2:$C$49
    I hope that you have a blessed day.

+ 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] conditional formatting - highlight top 3 values with duplicates
    By gssn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-31-2019, 08:02 AM
  2. [SOLVED] Highlight duplicates in two columns by Conditional Formatting
    By Max_excel in forum Excel General
    Replies: 11
    Last Post: 04-17-2018, 04:46 AM
  3. conditional formatting to highlight duplicates
    By makinmomb in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-04-2017, 07:13 AM
  4. [SOLVED] Conditional Formatting to find duplicates from 3 columns and highlight entire row.
    By bobjet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-16-2017, 05:20 PM
  5. [SOLVED] Conditional Formatting to highlight duplicates question
    By moretvicar in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-31-2015, 03:19 PM
  6. Replies: 3
    Last Post: 05-31-2013, 08:03 AM
  7. Using conditional formatting to highlight multiple duplicates
    By JONNY981 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-28-2010, 03:24 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