+ Reply to Thread
Results 1 to 4 of 4

Cell Fill Color based on multiple criteria

  1. #1
    Registered User
    Join Date
    11-11-2014
    Location
    England
    MS-Off Ver
    2010 and 2013
    Posts
    2

    Cell Fill Color based on multiple criteria

    Hi


    I have been looking into creating a simple formula that I can apply to a column in Excel. The basic functionality that I am trying to create is to shade a cell depending upon the values of two or more cells on the same work sheet.


    An example is as follows;

    If cell A1 contains the text "1 Hour" and cell B1 contains the text "No" then cell A1 should be filled with the colour red.

    If cell A1 contains the text "1 Hour" and cell B1 contains the text "Yes" then cell A1 should be filled with the colour amber.

    IF cell A1 contains the text "30 Minutes" and cell B1 contains the text "No" then Cell A1 should be filled with the colour green. In the case of the value in A1 being 30 Minutes there is no option to have B1 as anything but No.

    Ideally I would like to do this via a formula that the in-built conditional formatting tool will accept since I am really new to VBA. I can use conditional formatting to do this for a single cell value in A1, but I can't figure out how to work this when I introduce variables in both A1 and B1.

    Any help would be really appreciated!

  2. #2
    Forum Contributor
    Join Date
    08-04-2014
    Location
    Riga
    MS-Off Ver
    2010
    Posts
    579

    Re: Cell Fill Color based on multiple criteria

    Set up the CF rules necessary in a single cell, then, with the cell highlighted, use Format Painter to apply the rule to the rest of the data range.

  3. #3
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Re: Cell Fill Color based on multiple criteria

    Hi

    I have attached sample file incorporating your requests. I have referenced your criteria in columns D,E & F.
    Formula used in conditional formatting is referenced to these cells.
    Hope this helps!

    Cheers
    Attached Files Attached Files
    Don't forget to rate 1 who helped u, using "Star"

  4. #4
    Registered User
    Join Date
    11-11-2014
    Location
    England
    MS-Off Ver
    2010 and 2013
    Posts
    2

    Re: Cell Fill Color based on multiple criteria

    Thanks Guys, both solutions work and so I will go with that.

    Thanks for the example Mysore, that really helped me understand the logic of the formula!

    Cheers

+ 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: 1
    Last Post: 04-23-2014, 06:37 PM
  2. set cell fill color based on multiple conditions
    By StartingOut in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2011, 12:24 AM
  3. VBA-Fill color based on multiple criteria
    By kimmie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2011, 05:46 PM
  4. Color Fill Cell Based on Criteria
    By frankee_gee in forum Excel General
    Replies: 3
    Last Post: 04-24-2008, 02:55 PM
  5. Replies: 1
    Last Post: 05-27-2005, 01:05 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