+ Reply to Thread
Results 1 to 5 of 5

Using IF function to change font color

Hybrid View

  1. #1
    Registered User
    Join Date
    05-08-2009
    Location
    Bellingham,WA
    MS-Off Ver
    Excel 2003
    Posts
    13

    Using IF function to change font color

    Hey all,
    I'm trying to use Excel to keep team standings for a baseball board game. I had no problem calculating wining percentage. Finally figured out how to calculate 'games behind.' Now I'm wondering if there is a way to change the font color of a team name based on their wining pct?

    A typical row contains: A2(Team Name), B2 (Wins), C2 (Losses), D2 (Pct (B2/(B2+C2)), E2 (GB)

    Is there a way to use the IF function to return the 'Team Name' in green if D2>.500, 'Team Name' in red if D2<.500, and 'Team Name' in black if D2=.500 ??

    Thanks for any help.
    Sips
    Last edited by powerwindow; 05-09-2009 at 07:44 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Using IF function to change font color

    conditional format a2

    format/conditional formating
    choose formula is from dropdown
    formula is
    =d2>0.5 pick green font from formats
    =d2<0.5 pick red font
    no need to do =0.5 as it will just stay black any way
    Last edited by martindwilson; 05-09-2009 at 12:45 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Using IF function to change font color

    Yes, this is called CONDITIONAL FORMATTING.
    • Highlight the entire column Team Names starting with A2 as the first cell so it's still primary.
    • Click on Format > Conditional Formatting
    • Use these parameters:

      Condition1: Formula Is: =D2>.5
      Format: FONT (or pattern for background color changes): select a green

      Add>

      Condition2: Formula Is: =D2<.5
      Format: Font: select a red

    Now format the column in BLACK font for the ones the equal .5. The others will change themselves to red and green based on the values in column D.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    05-08-2009
    Location
    Bellingham,WA
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Using IF function to change font color

    Awesome! Thanks very much. Super easy.
    Sips

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Using IF function to change font color

    Glad we could help...if that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED].



    (Also, use the "scales" icon in our posts to leave Feedback, it is appreciated)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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