+ Reply to Thread
Results 1 to 10 of 10

Changing text colour in a cell based on value or colour of another cell.

  1. #1
    Registered User
    Join Date
    12-31-2018
    Location
    New Zealand
    MS-Off Ver
    10
    Posts
    7

    Changing text colour in a cell based on value or colour of another cell.

    Hi guys and girls, im wanting to be able to change the colour of text in a cell based on the value of another cell. So in my simple attached excel file. I would like cell C5 to have red text if cell B5 is greater than cell B3.
    I assume its maybe some conditional formatting with an "if" formula but im not sure the correct way to write this.
    Alternatively if Cell C5 could be changed to red text if cell B5 was red text that would work as well. Whichever way works would be ok. Thanks for any help that can be provided

    Kind regards John
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Changing text colour in a cell based on value or colour of another cell.

    Conditional Formatting as shown below.
    Attached Images Attached Images
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  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: Changing text colour in a cell based on value or colour of another cell.

    excel does not "see" colors, they are formatting, and excel works on data.

    You would (as you suggested) use Conditional Formatting for this, based on the values in B5 and B3. Something like...

    New Rule/Use Formula/ =B5 > B3 format fill to your desired color
    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
    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: Changing text colour in a cell based on value or colour of another cell.

    @ Alan, OP said > not > =

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Changing text colour in a cell based on value or colour of another cell.

    Got it Ford. Could not get the conditional formatting to work without the >=. I was never very good at CF. Always gives me agina.

  6. #6
    Registered User
    Join Date
    12-31-2018
    Location
    New Zealand
    MS-Off Ver
    10
    Posts
    7

    Re: Changing text colour in a cell based on value or colour of another cell.

    Hi Alan, thanks so much! that works and so simple You are a champion.

  7. #7
    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: Changing text colour in a cell based on value or colour of another cell.

    Heyyyy I gave the same suggestion (1 minute later)

    (just kidding - as long as you got what you needed )

  8. #8
    Registered User
    Join Date
    12-31-2018
    Location
    New Zealand
    MS-Off Ver
    10
    Posts
    7

    Re: Changing text colour in a cell based on value or colour of another cell.

    Hi Fdibbins, you are also a legend! You gave me some more background information as well so i gave you some reputation as well. Your prompt help is much appreciated

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,884

    Re: Changing text colour in a cell based on value or colour of another cell.

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

  10. #10
    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: Changing text colour in a cell based on value or colour of another cell.

    Thanks for the rep and the kind words - always appreciated.

+ 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: 11
    Last Post: 01-16-2018, 09:03 AM
  2. Changing chart colour to reflect colour of cell
    By hillwalker11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2016, 03:12 AM
  3. [SOLVED] Changing the colour of a cell based on PART of the text of the cell
    By Sanglorian in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2014, 12:48 AM
  4. Changing the colour of a cell based on the colour of another cell
    By Pete2931 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-11-2012, 03:35 AM
  5. [SOLVED] Macro to change text colour of adjacent cell to the same text colour as target cell
    By kayoke in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-28-2012, 04:18 AM
  6. Changing a cell's colour basing on other cells' colour
    By rhua5436 in forum Excel General
    Replies: 11
    Last Post: 09-23-2010, 05:49 AM
  7. Changing cell fill colour based on date in cell - Multiple rows
    By ExcelNewb2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2010, 07:30 AM

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