+ Reply to Thread
Results 1 to 2 of 2

Nesting cell fill colours within an "if" statement

  1. #1
    Registered User
    Join Date
    04-22-2020
    Location
    Hull, England
    MS-Off Ver
    Office 365
    Posts
    5

    Nesting cell fill colours within an "if" statement

    Hello All,

    I have an if statement in a cell g133, for example

    =IF(B127>=1,"Fail",IF(C135>85%,"pass","fail"))

    It works fine but i would like to fill cell g133 with a background colour subject to outcome of the if statement.

    Cell b127 contains a number of "totally un-acceptable failures", so working on a traffic light system, if it true then the background should be filled "RED" and with the word fail

    Assuming that b127 is false, we move onto the second part of the if statement.

    Cell C135 contains % pass mark. If it greater than 85%, it returns the word "pass" with a green fill colour, if not I need it to return the word "fail" with an "AMBER" fill colour.

    To be fair C135>85%, should probably have a greater than or equal to but I can work that, would just like to have advice how to create the colour fills

    kenny

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,492

    Re: Nesting cell fill colours within an "if" statement

    You’d use Conditional Formatting with different CF Formulae

    =B127>=1 format red
    =AND(B127<1, C135>85%) format green
    =AND(B127<1, C135<=85%) format amber
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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: 9
    Last Post: 03-05-2016, 12:53 AM
  2. "Worksheet change" not changing cell on other sheet to match target cell "fill".
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-02-2015, 12:02 PM
  3. Replies: 3
    Last Post: 06-05-2015, 01:55 PM
  4. Replies: 12
    Last Post: 06-12-2014, 02:11 PM
  5. [SOLVED] Cell Color with"if" statement testing for a "text" value
    By ARocketScientist in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2014, 09:01 PM
  6. [SOLVED] Formula Needed to fill multiple cells with "No" when the word "No" is entered into a cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2013, 05:36 PM
  7. [SOLVED] Combine "=IF" and "=HOUR" statement for cell formula
    By chriswhite1982 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2013, 02:42 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