+ Reply to Thread
Results 1 to 4 of 4

Using an IF Statement to Change a Cell a Certain Color

  1. #1
    Registered User
    Join Date
    03-15-2015
    Location
    Arizona
    MS-Off Ver
    Latest
    Posts
    11

    Using an IF Statement to Change a Cell a Certain Color

    Hey y'all,

    I have written an equation that checks to make sure every work shift is covered each day. It currently spits out "Covered" if the equation is true and "Problem" if it is false. In addition to the text, is there a way I can change the background of the "Covered" cell to green and the background of the "Problem" cell to red?

    Here is a shortened version of the equation I am currently using:

    =IF(AND(SUM(COUNTIF(O6:O26,{"E","E-9*","Eh","Eh-9*"}))=1,SUM(COUNTIF(O6:O26,{"K*","J-9*","Jh-9*","N","Nh","N-9","Nh-9"}))=1),"Covered","Problem")

    Thanks!

  2. #2
    Registered User
    Join Date
    03-15-2015
    Location
    Arizona
    MS-Off Ver
    Latest
    Posts
    11

    Re: Using an IF Statement to Change a Cell a Certain Color

    Never mind! Looks like I can just use a conditional statement for that cell.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Using an IF Statement to Change a Cell a Certain Color

    make all cells green using regular formatting

    Then use Conditional Formatting to make the color chat
    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =AND(SUM(COUNTIF(O6:O26,{"E","E-9*","Eh","Eh-9*"}))=1,SUM(COUNTIF(O6:O26,{"K*","J-9*","Jh-9*","N","Nh","N-9","Nh-9"}))=1) format fill RED
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-15-2015
    Location
    Arizona
    MS-Off Ver
    Latest
    Posts
    11

    Re: Using an IF Statement to Change a Cell a Certain Color

    Perfect. Thanks, FDibbins!

+ 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: 22
    Last Post: 03-08-2016, 08:19 PM
  2. [SOLVED] Change color on If and then Statement
    By justtune in forum Excel General
    Replies: 6
    Last Post: 11-20-2013, 01:41 PM
  3. Change Cell Color Based on If Then Statement
    By Jakelh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2012, 02:34 PM
  4. Change Cell Color Based on IF Statement
    By Cathy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-16-2005, 05:00 PM
  5. Replies: 3
    Last Post: 02-08-2005, 06:06 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