+ Reply to Thread
Results 1 to 10 of 10

Text color based on text in cell

  1. #1
    Registered User
    Join Date
    12-28-2021
    Location
    Athabasca, Alberta
    MS-Off Ver
    365
    Posts
    3

    Text color based on text in cell

    Hi. I simply want to change the color of the text in a cell to red if the number in that cell is less than 3. I want to be able to easily copy this same format to a range of cells.

    It seems super simple, but I have been trying to use conditional formatting and I can't get it to work correctly - however I am succeeding in getting frustrated.

    Any help for for this old newbie is appreciated.

    Thanks

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Text color based on text in cell

    Welcome to the forum.

    My rule of thumb is this: set the rule for one cell (the first in the range), then use the Applies To box in the dialog to set the range. I find this easier than relying on copyng and pasting.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Text color based on text in cell

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

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

    Re: Text color based on text in cell

    You will need to give us some examples of your data, as you say you want the text of a cell to change colour if the same cell contains a number that is less than 3.

    This implies that the cell contains both text and numbers, so the CF rule will need to be a formula that extracts the numerical part and then compares it with 3. You can use LEFT, RIGHT or MID to extract the numerical part, but as we haven't seen any examples of what your cell contains then it is difficult to be more specific than that.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    12-28-2021
    Location
    Athabasca, Alberta
    MS-Off Ver
    365
    Posts
    3

    Re: Text color based on text in cell

    Thanks for the reply Ali.

    I figured it out. The conditional formatting always refers to the point of view of the first cell in the range. My original formula was:

    =$C$4<3

    But the exact same formula was "copied" to all the other cells because of the $. So my new formula is:

    =$C4<3

    Bingo. So simple.

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

    Re: Text color based on text in cell

    Have I missed something, Ali?

    Pete

  7. #7
    Registered User
    Join Date
    12-28-2021
    Location
    Athabasca, Alberta
    MS-Off Ver
    365
    Posts
    3

    Re: Text color based on text in cell

    I did say text Pete, but it numbers in the cells. Sorry for making a simple question confusing.

    Thank you Pete and Ali for the help.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Text color based on text in cell

    Quote Originally Posted by Pete_UK View Post
    Have I missed something, Ali?

    Pete
    I don't know. What do you think you might have missed?

    Thank you Pete and Ali for the help.
    You're welcome.

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

    Re: Text color based on text in cell

    I was typing my response to Post #2 while you responded in Post #3, so I didn't see that until I submitted Post #4. By the time I responded to that, the OP had come in with Post #5, which helped to clarify things, but obviously the timings had overlapped.

    I must be getting slower in my old age.

    Pete

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,594

    Re: Text color based on text in cell

    Lol!

+ 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. change background textbox color based on text color in cell
    By atadaliran in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2021, 05:34 AM
  2. Replies: 1
    Last Post: 08-10-2020, 05:43 PM
  3. Auto color cell based on text, but leave existing text..
    By salameda in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2019, 04:35 PM
  4. VBA Set Color Text Variable based on color entry in a cell?
    By learning new things in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2018, 11:18 AM
  5. [SOLVED] Change text color of selected cells based on a text value of another cell
    By JNEWBURY2280 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-09-2014, 11:26 PM
  6. Macro to change cell text color based on darkness of cell fill color
    By cincyshirm61 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 12:11 PM
  7. change text color based on adjacent cell text color
    By matthewst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-01-2005, 03:49 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