Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if statement to change color of text (excel 2003 sp 2)

    I need an if statement in cell a1 to change the text to red if cell f1 is equal to zero. Can you help me?

    Thanks,
    Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: if statement to change color of text (excel 2003 sp 2)

    A formula in a cell cannot change the formatting of that (or any other) cell.
    You can use conditional formatting, however:
    - Select cell A1.
    - Select Format | Conditional Formatting...
    - Select "Formula Is" from the first dropdown.
    - Enter the following formula in the box next to the dropdown:

    =(F1=0)

    - Click the Format... button.
    - Activate the Font tab.
    - Select Red from the Color dropdown.
    - Click OK twice.

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: if statement to change color of text (excel 2003 sp 2)

    You can use conditional formatting for this. Select your cell, choose Format-Conditional Formatting, change the dropdown to Formula Is, then enter <code>=$F1=0</code> and choose your Format, then press OK.
    HTH
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •