+ Reply to Thread
Results 1 to 4 of 4

Conditional Formatting Formula to highlight first "N" in range

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Conditional Formatting Formula to highlight first "N" in range

    Hello Excel friends,

    I had to enter 7 formulas in Conditional Formatting to accomplish what I need. I am looking to see if someone can tell me an quicker, shorter, smarter and easier way to do it.

    In my sample sheet, I have a range of 7 columns (D-J) in which each cell can contain a (Y, N or NA). My goal is to find the first single letter N (representing NO) from left-to-right and execute the formatting (make the N a bold red). The Y or NA will be false and do nothing.

    To do this, in column K I placed a formula to search the range and note the first column in the range that contains an N (no NA). I didn't make column D an 4, rather, since it's first in my range I made it a 1 and likewise the last column J is column 7.

    I placed a conditional formatting formula in each cell (actually column).
    Column D looks like this:
    Please Login or Register  to view this content.
    Column J looks like this:
    Please Login or Register  to view this content.
    Of course each column has one and you can tell that each column is associated with its column number in the code.

    I'm wondering if there's a single formula that can be used instead of seven. Such as using CHOOSE($K$2,D2,E2,F2,G2,H2,I2,J2).

    Thanks to anyone who considers this and offers any assistance.

    Kind regards.
    Attached Files Attached Files

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Conditional Formatting Formula to highlight first "N" in range

    It's easy to do with one simple conditional formatting formula.

    1. First, delete all of the rules you have set up so far and column K, which is not needed..
    2. Select cell D2 and open the CF dialog to create a new formula rule: =AND(D2="N",COUNTIF($D2:D2,"N")=1)
    3. Set the formatting required.
    4. Set the range for the rule in the Applies To box.

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    ***
    Age
    Ctry
    A
    B
    C
    D
    E
    F
    G
    2
    Boy
    Six
    USA
    Y
    Y
    Y
    Y
    NA
    N
    Y
    3
    Boy
    Six
    USA
    Y
    Y
    Y
    N
    NA
    N
    Y
    4
    Boy
    Six
    USA
    Y
    N
    Y
    N
    NA
    N
    Y
    Attached Files Attached Files
    Last edited by AliGW; 02-23-2020 at 03:26 AM.
    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.

  3. #3
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Conditional Formatting Formula to highlight first "N" in range

    Thank you so very much. You are quite talented.
    That's exactly what I was hoping for and I hope that many others see and learn from this as I have. It's so much simpler and less busy in conditional formatting than my method of using multiple formulas.
    Kind regards

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Conditional Formatting Formula to highlight first "N" in range

    Thanks for the nice comment.

+ 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. Replies: 6
    Last Post: 08-14-2016, 11:42 AM
  2. [SOLVED] Conditional Formatting highlight duplicate values IF cell doesn't start with "XX"
    By deneh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2015, 04:44 AM
  3. Replies: 5
    Last Post: 07-25-2013, 01:57 AM
  4. [SOLVED] Conditional Formatting - Highlight Cells Rules "text that contains"
    By ggentry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 07:53 AM
  5. [SOLVED] Conditional formatting - formula if cell does NOT contain "," or "@"
    By Armitage2k in forum Excel General
    Replies: 12
    Last Post: 12-02-2012, 06:23 AM
  6. Replies: 2
    Last Post: 08-17-2012, 05:10 AM
  7. Replies: 2
    Last Post: 06-11-2012, 06:08 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