+ Reply to Thread
Results 1 to 12 of 12

How to use conditional formatting on multiple cells, depending on other cell values

  1. #1
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    How to use conditional formatting on multiple cells, depending on other cell values

    Hi
    I'd like to change a cell's fill colour depending on the values in another cell relative to it.
    I've managed to use the formula to indicate what I want the cell to do, but I want to replicate it right down the column.

    Here's an example...

    If A2 is blank then B2 is yellow
    If A3 is blank then B3 is yellow
    If A4 is blank then B4 is yellow

    And so on.
    Simple query, tricky to find the answer.
    Many thanks in advance.

  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,970

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Select cell B2 and create your rule:

    =A2=""

    Set the required formatting.

    Using the applies to box, set the range to which the rule will apply (e.g. $B$2:$B$100).

    That’s it. No need to try to copy anything down.
    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
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    That's brilliant! Many thanks

  4. #4
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Actually not working....but I think that's my formula rather than 'applies to cells' part.

    There are two rules:
    =A2<>" "
    (meaning A2 is not blank)
    =A3=" "
    (meaning A3 is blank)

    I don't have the 'stop if true' boxes checked in the conditional formatting dialogue box - I want both rules to be true to trigger the font colour in B2.

    As it stands, all the cells in column B are yellow, irrespective of the values in A.

    Hope someone can disentangle this for me?

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Try

    =A2=""

    Not

    =A2=" "

    Can you see the difference? The first one is looking for blanks, the second one is not.

  6. #6
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Yes. Tried that too, but it's not working for some reason. All the cells are yellow rather than just the ones that meet these two conditions.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Have you checked the 'applies to' ranges?

    Not sure of the exact cause but I have seen occasions where they can change unexpectedly when you edit the rules.

    =A2="" to check blank

    =A2<>"" to check non blank. Note in both cases, no space between the double quotes.

  8. #8
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    I thought the 'applies to' range is where the cell formatting appears? If so, then the formatting is appearing there, but not consistently with the rules.

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    You are correct, that is what the applies to range refers to, but it id it is out of alignment with the rule then it can produce unexpected results.

    If you apply a rule, =A2="" to the range, $B$2:$B$100, then in theory B2 should relate to A2, B3 to A3, etc.

    However it is based on the active cell when you apply the rule, so if select B2:B100, but B3 is the activecell, then applying =A2="" as a rule would apply the formatting 1 row lower than expected.

    See if that helps you find the cause of the problem.

    The cause is most likely something simple, finding it could be anything but simple without seeing the file.

  10. #10
    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,970

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Maybe this?

    =AND(A2="",A3<>"")

  11. #11
    Forum Contributor
    Join Date
    08-23-2010
    Location
    uk
    MS-Off Ver
    365 on Mac
    Posts
    146

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    Yes!
    Thank you again.

  12. #12
    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,970

    Re: How to use conditional formatting on multiple cells, depending on other cell values

    You’re welcome!

+ 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. Conditional formatting with values from multiple cells
    By LilJur in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-20-2017, 06:12 PM
  2. [SOLVED] Conditional Formatting based on Multiple Values of other Cells
    By Sovrin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-03-2016, 08:10 PM
  3. [SOLVED] Conditional formatting for cells containing multiple values.
    By chaitreya in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-24-2015, 03:40 PM
  4. Conditional formatting, based ot multiple values in 2 cells.
    By kaosbg in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2014, 02:47 PM
  5. Replies: 1
    Last Post: 11-10-2014, 07:23 AM
  6. Conditional Formatting for whole range depending on cell values
    By ChrisGranco in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-05-2013, 08:33 AM
  7. [SOLVED] Adding Values in Multiple Offset Cells depending on the value of a different cell
    By lottidotti in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-19-2012, 11:35 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