+ Reply to Thread
Results 1 to 4 of 4

Cell Color with"if" statement testing for a "text" value

  1. #1
    Registered User
    Join Date
    03-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    1

    Cell Color with"if" statement testing for a "text" value

    There is now a second half.

    First day and first question. Thank you all in advance.

    Volunteered for a church "quick" spreadsheet mod. I know never volunteer for anything. (never again)

    I am trying to change the cell fill color based on a "text" value in the cell.

    Example: if(B27="CREDIT",[cell fill color=Blue],[cell fill color=Red])

    The statements in brackets represent what I want to do.
    I don't know how to and haven't found anything in MS help that doesn't reference conditional formatting.
    Nothing I can find in conditional formatting will let you test for a "text" value; numeric only.

    A. How do I define a color value ?
    B. Am I just missing something in conditional formatting ?
    C. I am not allowed by the church I'm doing this for to use VBA.
    D. I would like to avoid a macro for the ease ** future spreadsheet user/managers.


    Second half:

    Similar problem, I again want to change color, how do I test for multiple "text" possibilities ?

    Example the cell could contain "Mark" or "Bill" or "Jennifer" or "Kevin", each with there own assigned color.


    Again, thanks for the help.

    "Doc"
    Last edited by ARocketScientist; 03-08-2014 at 01:56 PM. Reason: Typo

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,721

    Re: Cell Color with"if" statement testing for a "text" value

    Select cell B27, click on Conditional Formatting | New Rule | Use a formula... , then enter this formula in the dialogue box:

    =B27="Credit"

    Then click on the Format button, select the Fill tab and choose your colour (i.e. Blue). Then OK your way out. Apply a background colour of Red to that cell. CF colours take precedent over normal background colours, so you don't need to set up a second conditional format. Then you can use the Format Painter to apply that to other cells if you need to.

    Hope this helps.

    Pete

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

    Re: Cell Color with"if" statement testing for a "text" value

    For the 2nd part, use Pete's suggestion, just create new rules for each text
    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
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,721

    Re: Cell Color with"if" statement testing for a "text" value

    It's not a good idea to amend your first post and add another follow up question there - posters who have subscribed to the thread will not get a notification ** the change you have made. Just add a new post to the thread instead.

    Hope this helps.

    Pete

+ 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: 4
    Last Post: 11-17-2013, 12:05 PM
  2. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  3. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  4. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 AM
  5. Replies: 3
    Last Post: 12-14-2006, 01:36 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