+ Reply to Thread
Results 1 to 9 of 9

Highlight row for every first unique value

  1. #1
    Registered User
    Join Date
    11-01-2006
    Location
    Whitstable, Kent, UK
    MS-Off Ver
    MS 365
    Posts
    26

    Highlight row for every first unique value

    Hi
    In column C on a large sheet, I have ID numbers in a format similar to AZO01B000034-10296-AZO01AMC0011-31008.
    The same ID will be listed across a number of rows, and then very few rows the ID will change, e.g.

    Column C
    AZO01B000034-10296-AZO01AMC0011-31008
    AZO01B000034-10296-AZO01AMC0011-31008
    AZO01B000034-10296-AZO01AMC0011-31008
    AZO01B000034-10296-AZO01AMC0011-30291
    AZO01B000034-10296-AZO01AMC0011-30291
    AZO01B000034-10296-AZO01AMC0011-29625
    AZO01B000034-10296-AZO01AMC0011-29625
    AZO01B000034-10296-AZO01AMC0011-29625
    AZO01B000034-10296-AZO01AMC0011-29625
    AZO01B000034-10296-AZO01AMC0011-29601
    AZO01B000034-10296-AZO01AMC0011-29601
    AZO01B000034-10296-AZO01AMC0011-29601

    How do I format the entire row that has the first instance of each unique ID number?

    Many thanks.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,209

    Re: Highlight row for every first unique value

    HOW TO ATTACH YOUR SAMPLE WORKBOOK: Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    03-05-2025
    Location
    Deutschland
    MS-Off Ver
    MS Office Home & Business 2024
    Posts
    190

    Re: Highlight row for every first unique value

    Hi Kenneth,

    format condition, and the formula is: =COUNTIF($C$1:C1;C1)=1

    BR, Alexandra

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Highlight row for every first unique value

    You did not mention conditional formatting, but I'm going to assume you know how it works. If not, let me know and I'll give you step-by-step.

    Use this as your conditional formatting rule. You say "the entire row" but I am sure you are not using 16,000 columns. The Applies To range is $A:$Z, where Z is the last column you are actually using. Change to suit.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,494

    Re: Highlight row for every first unique value

    Since the data was in the srartpost I copied it to an example file for you.

    What you want is easy to achieve with a conditional format formula
    with this formula:

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


    the key is to expand the count range for every row and only fix the topleft cel with $
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,209

    Re: Highlight row for every first unique value

    CF rule for C1:

    =COUNTIF($C$1:$C1,$C1)=1

    Applies to: $C:$C

    And it's a COLUMN, not a row.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Highlight row for every first unique value

    Please note:

    Quote Originally Posted by cysu11 View Post
    format condition, and the formula is: =COUNTIF($C$1:C1;C1)=1
    Quote Originally Posted by Roel Jongman View Post
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Quote Originally Posted by AliGW View Post
    CF rule for C1:

    =COUNTIF($C$1:$C1,$C1)=1

    Applies to: $C:$C
    OP requested to "format the entire row."

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,209

    Re: Highlight row for every first unique value

    Just needs to change the applies to range accordingly, although I see no benefit in highlighting hundreds of columns.

    This should de:

    Applies to: $A:$ZZ

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Highlight row for every first unique value

    Here is my formula applied to a mock-up, with an additional condition to exclude a header row. OP did not show a header row, but there almost always is one.

    A
    B
    C
    D
    1
    Some Data
    Some more Data
    Some String
    Some Other Data
    2
    6
    36
    AZO01B000034-10296-AZO01AMC0011-31008
    44
    3
    36
    80
    AZO01B000034-10296-AZO01AMC0011-31008
    4
    4
    72
    48
    AZO01B000034-10296-AZO01AMC0011-31008
    23
    5
    96
    93
    AZO01B000034-10296-AZO01AMC0011-30291
    70
    6
    100
    45
    AZO01B000034-10296-AZO01AMC0011-30291
    72
    7
    18
    97
    AZO01B000034-10296-AZO01AMC0011-29625
    39
    8
    62
    30
    AZO01B000034-10296-AZO01AMC0011-29625
    37
    9
    96
    11
    AZO01B000034-10296-AZO01AMC0011-29625
    29
    10
    38
    5
    AZO01B000034-10296-AZO01AMC0011-29625
    91
    11
    97
    62
    AZO01B000034-10296-AZO01AMC0011-29601
    37
    12
    76
    71
    AZO01B000034-10296-AZO01AMC0011-29601
    77
    13
    84
    47
    AZO01B000034-10296-AZO01AMC0011-29601
    32


    Conditional Formatting Rules
    Formula
    Applies To Formula Format Stop If True
    $A:$D =AND(ROW(A1)>1,COUNTIF($C$1:$C1,$C1)=1) False

+ 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] Highlight duplicates - but trailing zero should be a unique value
    By RookA1 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 10-14-2022, 04:20 PM
  2. [SOLVED] highlight unique values between two workbooks
    By MarkFltc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2017, 01:49 PM
  3. [SOLVED] Highlight Unique Data
    By hftechno in forum Excel General
    Replies: 2
    Last Post: 10-02-2015, 05:21 PM
  4. [SOLVED] Highlight a unique value with duplicate entries
    By scotland9 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2015, 09:47 AM
  5. Highlight and Tag Unique Instances
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-08-2013, 08:24 PM
  6. Highlight column once unique ID found
    By Hnedjari in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2012, 12:20 PM
  7. Need to Highlight Unique Value
    By Ocean Zhang in forum Excel General
    Replies: 2
    Last Post: 06-07-2011, 01:17 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