×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Excel - Change Text Color Within “IF” Formula

Excel - Change Text Color Within “IF” Formula

Excel - Change Text Color Within “IF” Formula

(OP)
Excel Spreadsheet
Microsoft Office Standard 2010

Within the following formula, I want the red portion to appear red if the applicable conditions apply.

=IF(F35<F24,(IF(F34<F24,"Plate must be wider than beam flange >>>","Actual / Specified Plate Width =")),"Actual / Specified Plate Width")

When inside of the editing mode, when I highlight the applicable text, the font editing options fade making it unable to edit or change the color.

How can I do this?

Suggestions? Comments?

Thank you!

RE: Excel - Change Text Color Within “IF” Formula

Put the following formula in a different cell, let's assume cell A1, to determine the need for the color change:
=IF(F35<F24,IF(F34<F24,1,0),0)
Apply conditional formatting on the cell where the text needs to change color (the one with your above formula). Create a new rule: Use a formula to determine which cells to format, in the "Format values where this formula is true" box, select A1 (it will enter $A$1, but that's fine). Click Format, then select the color red for the font color and click OK.

Under that condition, the text will be red; under all others it will be black.

xnuke
"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand, Atlas Shrugged.
Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.

RE: Excel - Change Text Color Within “IF” Formula

You need to look into using conditional formatting to achieve this type of formatting. It should be fairly self explanatory using either cell value equals or a formula based on the inequality you have in the if statement, but post back if you cannot achieve what you're after.

You cannot change text colour using an IF statement like you're trying to do.

RE: Excel - Change Text Color Within “IF” Formula

(OP)
Got it!

Success!

Just gotta know how!

Thank you all!

RE: Excel - Change Text Color Within “IF” Formula

Nice, IR! Even simpler than mine.

xnuke
"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand, Atlas Shrugged.
Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.

RE: Excel - Change Text Color Within “IF” Formula

IRS: Is that ever useful...

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik

RE: Excel - Change Text Color Within “IF” Formula

We use that sort of formatting, along with dark green on light green background all the time for test data sheets to show pass/fail; unfortunately, we often have more fails than passes, which is not a good look curse

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm

RE: Excel - Change Text Color Within “IF” Formula

Dik, I find visual "colour" cues are much better than just writing some text on a sheet regarding a failure that may not grab the users attention.

Looks bad in calculations if bad red cells are still present, designer or checker cannot really ignore the error inadvertently. Designer needs to alter design until all aspects pass for example, much harder to miss.

RE: Excel - Change Text Color Within “IF” Formula

concur... highlights things to check to see if they are close enough to accept....lol

Rather than think climate change and the corona virus as science, think of it as the wrath of God. Feel any better?

-Dik

RE: Excel - Change Text Color Within “IF” Formula

I almost always use
Use a formula to determine which cell to format
in my CR Rule Type.

In this case the formula I'd use is

=AND(F35<F24,F34<F24)

...so when that expression is TRUE, the CF is applied. These are the values that the IF is using.

But I absolutely hate cell notation! I would be using Named Range names in all my references. Makes understanding what's going on much easier!

PS: something else to consider. What if the boss wants the wording changed to exclude the word "must"? The criteria may be met in cells F34, F35, F24, but the CR criteria is not connected to the main criteria, but some other arbitrary value that has nothing to do with F34, F35 & F24.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close