+ Reply to Thread
Results 1 to 3 of 3

Change background colour of a cell based on value of another cell

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Change background colour of a cell based on value of another cell

    I have the following data:

    A B
    1 Brian 36
    2 Tony 7
    3 Lisa 8
    4 Abe 0
    5 Phil 25
    6 May 0

    Is it possible to colour the name in Column based on the value in Column B.
    For example if a staff member has a result of 0 then the cell with their name will
    have a backgroud colour of Red. If they get >0 but <19 then they will
    have a background colour of blue. For a result of >=19 but less than 100
    the background colour would be green.

    Abe and May would get a background colour of Red as they have both a 0 result
    Tony and Lisa would get a background colouor of Blue, they are >0 but less than 19
    Brian and Phil would get a background colour of Green, they have >19 but less than 100

    Any help would be much appreciated, then I can could the cells based on their colour.
    Mary

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Change background colour of a cell based on value of another cell

    Use Conditional Formatting

    Select A1
    New Rule, use a formula to determine...
    =(B1=0)
    Format as red

    New Rule, use a formula to determine...
    =(AND(B1>0,B1<19)
    Format as Blue

    New Rule, use a formula to determine...
    =(AND(B1>=19,B1<100)
    Format as Green

    Use Format Painter to copy down column A
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Change background colour of a cell based on value of another cell

    Use conditional formatting..

    See attached.

    Any help would be much appreciated, then I can could the cells based on their colour.
    For counting cells you could simply use COUNTIF/COUNTIFS

    hence,
    =countif(Range,0)
    =COUNTIFS(Range,"<19",Range,"<>0")
    =COUNTIFS(Range,"<100",Range,">=19")
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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