+ Reply to Thread
Results 1 to 5 of 5

Need formula to shade cell if < or > half of another cell

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    39

    Need formula to shade cell if < or > half of another cell

    To clarify title. Need to be able to shade a cell if the input number is , < half the number in another cell or > 1.5 that same cell. Can be same color shade. Shade doesn't matter.


    Example: Cell A1 is 50, I need to set B1 to shade if < 25 or > 75
    Cell A2 is 25, B2 to shade if < 12.5 or > 37.5

    Etc.
    Last edited by brians34; 06-26-2013 at 03:02 PM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: Need formula to shade cell if < or > half of another cell

    OR(b1<A1/2, b1>A1*1.5)

    if you put

    OR(b1<A1/2, b1>A1*1.5)
    in conditional format
    and choose colour - that will do what I think you need

    see attached example

    thought I would test a script for conditional formatting - as i like the detail in jeffreybrown reply - hope you dont mind the copy

    for 2007 or 2010 excel version

    Conditional Formatting

    Highlight applicable range >>

    B1

    Home Tab >> Styles >> Conditional Formatting
    New Rule >> Use a formula to determine which cells to format
    Edit the Rule Description: Format values where this formula is true:

    =OR(B1<A1/2,B1>A1*1.5)

    Format… [Number, Font, Border, Fill]
    OK >> OK
    Attached Files Attached Files
    Last edited by etaf; 06-26-2013 at 02:00 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Need formula to shade cell if < or > half of another cell

    Try...

    Conditional Formatting
    • Highlight applicable range >> B1
    • Home Tab >> Styles >> Conditional Formatting
    • New Rule >> Use a formula to determine which cells to format
    • Edit the Rule Description: Format values where this formula is true: =OR(B1<A1/2,B1>A1*1.5)
    • Format… [Number, Font, Border, Fill]
    • OK >> OK
    HTH
    Regards, Jeff

  4. #4
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Need formula to shade cell if < or > half of another cell

    To build on what the other guys told you. If you want the cells to remain unformatted if blank, add another conditional format that is "Format only cells that contain" and choose "blanks". Make this the first (top) condition and check the box to the right to "Stop If True".
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  5. #5
    Registered User
    Join Date
    11-07-2008
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    39

    Re: [SOLVED] Need formula to shade cell if < or > half of another cell

    Thanks to all three of you.

    Great help.

+ 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