+ Reply to Thread
Results 1 to 8 of 8

Conditional Formatting based on Row value count

  1. #1
    Registered User
    Join Date
    10-22-2018
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    4

    Conditional Formatting based on Row value count

    Hi All,

    Assuming that I have a table with 10 columns and 10 rows. I would like to highlight a value in a row if that value is the only value in that row.
    I tried Conditional Formatting with COUNTA=1, however that does not work.

    Any ideas?

    Best regards,
    Flash

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting based on Row value count

    Hello and welcome to the forum.

    If your range is A2:J11, highlight A2:J11 > Conditional Formatting > New Rule > Use a formula
    =SUMPRODUCT((ROW($A$2:$J$11)=ROW(A2))*(A2<>"")*(COUNTA($A2:$J2)=1))
    Format: Fill color of your choice > OK > OK

  3. #3
    Registered User
    Join Date
    10-22-2018
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Conditional Formatting based on Row value count

    Hi falcondude,

    Thanks for your quick help and welcome.

    The formula works for a simple table as described in my initial problem statement.
    However, if I apply the same formula to a range in a pivot table (e.g. Range B5:Q29) it does not work anymore.
    Any chance you know what the issue is here?

    Best regards,
    Flash

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting based on Row value count

    Did you adjust the formula in post #2 to suit the new range?

    If your range is B5:Q29, you would select B5:Q29, go through the steps outlined above, then use this formula:

    =SUMPRODUCT((ROW($B$5:$Q$29)=ROW(B5))*(B5<>"")*(COUNTA($B5:$Q5)=1))

  5. #5
    Registered User
    Join Date
    10-22-2018
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Conditional Formatting based on Row value count

    Great, that works perfectly. Instead of the COUNTA per row I had Q29, that's why it didn't work.

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting based on Row value count

    Happy to help. 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.

  7. #7
    Registered User
    Join Date
    10-22-2018
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Conditional Formatting based on Row value count

    Would you also be able to explain what the formula does in detail?

    Thanks in advance.

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting based on Row value count

    After looking at this again, I realized that the formula can be simplified.

    I would use this:
    =AND(B5<>"",COUNTA($B5:$Q5)=1)

    The formula starts in the upper left cell of the range that you highlighted. Since you highlighted B5:Q29, the formula starts in cell B5.

    The ROW test isn't needed.

+ 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. Sum/ Count colored cells based on conditional formatting
    By V.Cell in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-19-2018, 06:37 AM
  2. [SOLVED] Collecting a count based on conditional formatting
    By jnepsa in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-20-2017, 03:13 PM
  3. Count Cells Based on Colour Determined by Conditional Formatting
    By RanCanMan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2015, 09:45 AM
  4. [SOLVED] Count cells based on Conditional formatting
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2014, 03:41 PM
  5. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  6. Count blank cells by colour based on conditional formatting
    By mb0202 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-03-2013, 07:37 AM
  7. count if formula based of conditional formatting??
    By Lorna B in forum Excel General
    Replies: 7
    Last Post: 06-16-2012, 12:31 PM

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