+ Reply to Thread
Results 1 to 11 of 11

conditional formatting: greater or less than 5% of average

  1. #1
    Registered User
    Join Date
    10-05-2017
    Location
    usa
    MS-Off Ver
    2013
    Posts
    11

    conditional formatting: greater or less than 5% of average

    Hello,
    I try to figure out how to format a spreadsheet to find which cells are 5% different in either direction from an average of those cells.
    e.g. I have cells a1-g1 and want to know which of those values are greater or less by x% than the average from those. I would prefer that I have a cell with a certain number that counts as this x% so I can easily adjust the %-values and play around

    best regards
    SMLlab

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,288

    Re: conditional formatting: greater or less than 5% of average

    Enter your % diff in, say, cell H1.

    Then select cells A1:G1, and apply CF using the Formula option, with this formula (to identify above the average)

    =A1>(AVERAGE($A1:$G1)*(1+$H1))

    and choose your format. Then do that again, and add another level, with this formula (for below average)

    =A1<(AVERAGE($A1:$G1)*(1-$H1))

    If you don't care about differentiating above and below, then just use

    =OR(A1>(AVERAGE($A1:$G1)*(1+$H1)), A1<(AVERAGE($A1:$G1)*(1-$H1)))
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    10-05-2017
    Location
    usa
    MS-Off Ver
    2013
    Posts
    11

    Re: conditional formatting: greater or less than 5% of average

    Hello Bernie,
    thank you so much for your quick answer. Unfortunately it doesn't show me the cells that are off.
    formula.jpg
    formula1.jpg
    Attached Images Attached Images
    Last edited by SMLlab; 10-05-2017 at 02:03 PM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,313

    Re: conditional formatting: greater or less than 5% of average

    Change the $H1 to $H$1 in each of the formulae and put the difference in cell H1, for example, 5%
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,288

    Re: conditional formatting: greater or less than 5% of average

    Two things :

    1) Enter 0.01 or 1% not just the number 1. 1 is the same as 100%

    2) Use $I$9 if you want that one cell to apply to multiple rows: my formula was written to only act on one row so that if it were copied down the limit would also rely on the value entered into that row.

  6. #6
    Registered User
    Join Date
    10-05-2017
    Location
    usa
    MS-Off Ver
    2013
    Posts
    11

    Re: conditional formatting: greater or less than 5% of average

    Hello,
    thank you, that worked very well. 0.05 instead of 5% make so much more sense.
    I am wondering about the D11 in the formula. If I write D11>(average...) doesnt it mean that if D11 is 5% different from the average than those conditions apply?

  7. #7
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: conditional formatting: greater or less than 5% of average

    Quote Originally Posted by Bernie Deitrick View Post
    Enter your % diff in, say, cell H1.
    this is shorter

    =ABS(A1/(AVERAGE($A1:$G1)-1)>$H$1

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,288

    Re: conditional formatting: greater or less than 5% of average

    The D11 should be whatever the activecell is at the time that the formula is written - Excel will update cell references just as if a formula were copied from that cell to the others. So, if you selected D11:G11 by clicking and dragging from D11 to G11, then the formula should use D11. If you clicked G11 and dragged to D11, then the D11 should be G11. The correct address should be shown to the far left of the formula bar, which was not included in your screen capture post.

  9. #9
    Registered User
    Join Date
    10-05-2017
    Location
    usa
    MS-Off Ver
    2013
    Posts
    11

    Re: conditional formatting: greater or less than 5% of average

    Hello Bernie,
    somehow I understand what you mean, but then still I don't understand...
    Is it possible to avoid either D11 or G11 but just have the average of the whole row and from that average have the 5% off formatting?
    And does this also mean I can't use the format painter and expect the formula adjust accordingly since it would always refer to D11 (or G11)?
    I would have to use the rows D12, D13 etc as well as O11, O13 etc

    I've tried to change D11 to another cell where I have written the average across the row but it didnt change anything - probably since there is an average in the formula already
    Last edited by SMLlab; 10-06-2017 at 04:35 PM.

  10. #10
    Registered User
    Join Date
    10-05-2017
    Location
    usa
    MS-Off Ver
    2013
    Posts
    11

    Re: conditional formatting: greater or less than 5% of average

    @tim201110
    Thank you for the shortened formula. There was a bracket missing after -1 and it should be ABS(A1/(AVERAGE($A1:$G1)-1))>$H$1 instead. Still have to figure out how to apply the formula without having A1 (or D11 in my case) as part of the condition.

  11. #11
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,288

    Re: conditional formatting: greater or less than 5% of average

    OK - let's look at my first formula, applied to cell A1:


    =A1>(AVERAGE($A1:$G1)*(1+$H1)

    When copied to B1, the formula becomes

    =B1>(AVERAGE($A1:$G1)*(1+$H1)

    Nothing about the columns referred to changes except for the A1 to B1.

    When the formatting is copied to A2, that formula becomes


    =A2>(AVERAGE($A2:$G2)*(1+$H2))

    The row changes because the $ are only applied to the column addresses.

    Remember, $ before a column or row prevents that reference from being updated when the formula (or formatting, in this case) is copied and pasted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Conditional Formatting greater than 0 but not 0
    By TotallyLost in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-25-2016, 12:59 PM
  2. Conditional formatting - Greater than or equal to
    By mmotorsport in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-28-2014, 04:40 PM
  3. [SOLVED] Conditional formatting if equal or greater than average in the range of cells
    By Abu Abdurakhim in forum Excel General
    Replies: 7
    Last Post: 05-28-2013, 10:01 AM
  4. Excel 2007 : Conditional formatting-Value is greater than
    By satishtote123 in forum Excel General
    Replies: 1
    Last Post: 06-11-2011, 12:17 PM
  5. Conditional Formatting and Greater than BUT less than
    By dagindi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-07-2010, 03:08 PM
  6. Conditional Formatting greater than 100%
    By henro8 in forum Excel General
    Replies: 5
    Last Post: 10-08-2008, 05:18 PM
  7. Conditional Formatting if greater than zero
    By jkpha in forum Excel General
    Replies: 2
    Last Post: 10-31-2007, 01:50 PM

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