+ Reply to Thread
Results 1 to 6 of 6

How do I make an IF statement change cell shading

  1. #1
    Binglesworth
    Guest

    How do I make an IF statement change cell shading

    How do I a make an IF statement change the color of the cell based on the
    number inputted? For example I want 0-5 to be clear, 5-10 to be yellow, 10+
    to be red. I want to also change the text properties to change the color of
    the text. Can either be done?

  2. #2

    Re: How do I make an IF statement change cell shading

    Hi

    It is called conditional formatting.
    on the menu -> Format -> Conditional format.

    think about it. How would you use an if statement to change the shading
    of that same cell while still having a value in that cell that's
    independant of the if statement. So the bottomline is, whatever change
    the shading of the cell HAS to be seperate from the cell value.
    Therefore you can't controll it with a if but have to use conditional
    formatting.

    Rgds
    CE AUKE


  3. #3
    Forum Contributor
    Join Date
    08-28-2005
    Posts
    298

    cell shading!

    hi!

    select your range (say A1:A10)

    goto Format >> Conditional Formatting >>
    condition 1 : select Formula Is: =A1<=5 format as your wish
    then Add >>
    condition 2 : select Formula Is: =AND(A1>5,A1<=10) format as you like
    again Add>>
    condition 3: select Formula Is =A1>10 format as per your choice

    -via135



    Quote Originally Posted by Binglesworth
    How do I a make an IF statement change the color of the cell based on the
    number inputted? For example I want 0-5 to be clear, 5-10 to be yellow, 10+
    to be red. I want to also change the text properties to change the color of
    the text. Can either be done?

  4. #4
    Zack Barresse
    Guest

    Re: How do I make an IF statement change cell shading

    Hi there Binglesworth,

    For your text, format the cell as you would normally format any cell. We'll
    let that be our "default" format. Then, with the cell selected, go to Tools
    | Conditional Formatting. You can add up to 2 more conditional formats, set
    your cell values in the given drop downs to specified, change the format for
    each condition to that which you want and click Ok.

    HTH

    --
    Regards,
    Zack Barresse, aka firefytr
    To email, remove NOSPAM


    "Binglesworth" <[email protected]> wrote in message
    news:[email protected]...
    > How do I a make an IF statement change the color of the cell based on the
    > number inputted? For example I want 0-5 to be clear, 5-10 to be yellow,
    > 10+
    > to be red. I want to also change the text properties to change the color
    > of
    > the text. Can either be done?




  5. #5
    Trevor Shuttleworth
    Guest

    Re: How do I make an IF statement change cell shading

    Not with an IF in the cell. What you could do is use the same IF Formula in
    Conditional Formatting and change the format accordingly.

    Regards

    Trevor


    "Binglesworth" <[email protected]> wrote in message
    news:[email protected]...
    > How do I a make an IF statement change the color of the cell based on the
    > number inputted? For example I want 0-5 to be clear, 5-10 to be yellow,
    > 10+
    > to be red. I want to also change the text properties to change the color
    > of
    > the text. Can either be done?




  6. #6
    Biff
    Guest

    Re: How do I make an IF statement change cell shading

    Hi!

    Use conditional formatting.

    Your ranges overlap:

    0-5 to be clear
    5-10 to be yellow

    If the number is 5 what color should it be? Clear or yellow?

    Select the cell in question. I'll assume it's A1.
    Goto format>Conditional Formatting
    Condition 1
    Formula is: =AND(ISNUMBER(A1),A1>10)
    Click the Format button
    Select the desired style(s)
    OK
    Click the ADD button
    Condition 2
    Formula is: =AND(ISNUMBER(A1),A1>=6)
    Clcik the format button
    Select the desired style(s)
    OK out

    Biff

    "Binglesworth" <[email protected]> wrote in message
    news:[email protected]...
    > How do I a make an IF statement change the color of the cell based on the
    > number inputted? For example I want 0-5 to be clear, 5-10 to be yellow,
    > 10+
    > to be red. I want to also change the text properties to change the color
    > of
    > the text. Can either be done?




+ 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