+ Reply to Thread
Results 1 to 11 of 11

Conditional Formatting based on percentage differences

  1. #1
    Registered User
    Join Date
    12-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft 365
    Posts
    13

    Conditional Formatting based on percentage differences

    My table example is quite simple but drawn from percentages. I am not working with raw numbers.

    Column A = demographics; Column B = This Year (format as %); Column C = Last Year (format as %)


    I would like to apply a conditional format to values in the B column when the value is more than, less than or equal to 4% different to the value in the C column.

    I would like to change the fill colour of Column B value to orange when the condition is met. In the example, this would change B3 and B4 as the difference between the cells is 5% higher (B3 and C3) and 7% lower (B4 and C4).

    Can anyone help?
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Conditional Formatting based on percentage differences

    So I highlighted all of column B, selected conditional formatting, new rule, use formula to determine which cells to format, and then put in this formula:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    12-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft 365
    Posts
    13

    Re: Conditional Formatting based on percentage differences

    I followed your guidance which did indeed work on B4 where the difference was 7% less but did not change B3 which was 5% greater.
    However, I applied the logic of a new rule where the formula was

    Code:
    ---------
    =ABS($C1-$B1)<=0.04
    ---------

    Is this too simplistic? Thanks for your prompt reply.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Conditional Formatting based on percentage differences

    Did you select the entire column or just B2:B4? When I applied Arkadi's CF rule to $B:$B both B3 and B4 highlighted.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    12-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft 365
    Posts
    13

    Re: Conditional Formatting based on percentage differences

    No, but that has corrected and now works.

    Thanks

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Conditional Formatting based on percentage differences

    You're Welcome. If that takes care of your original question, please select Thread Tools from the menu link above your first post and mark this thread as SOLVED. I hope that you have a blessed day.

  7. #7
    Registered User
    Join Date
    12-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft 365
    Posts
    13

    Re: Conditional Formatting based on percentage differences

    Thanks JeteMc for your replies.

    You answered the question about how to apply a conditional format when there was a 4% or higher statistical difference.

    I have updated my spreadsheet with variable data where again I would like to highlight the cell in column b (this is on a different sheet) if the percentage difference is greater than or equal to 4%.

    Some rows where the difference is higher are positive and some are negative and my only reference to these is in column D where I have added "HG" - higher difference is good or "HB" - higher difference is bad.

    Is it possible to advise what formula could be created for this column to manage both situations?
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Conditional Formatting based on percentage differences

    Here is a two rules solution where one rule is for the green fill and the other is for the red fill. The two new rules will need to precede the rule that generally highlights cells in column B that have a difference of +/- 4% from those in column C, providing that you still want to keep that rule.
    The formula for the green fill is: =D1="HG"
    The formula for the red fill and white font is: =D1="HB"
    Let us know if you have any questions.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft 365
    Posts
    13

    Re: Conditional Formatting based on percentage differences

    Hi again JeteMc,
    I really do appreciate your help, however some cells are not formatting correctly.
    I have attached the sample file and added further data. In column F, I have added narrative where the conditional format works and where it does not.

    In your rules, you specify that the format change takes place if column D = either HB or HG and then the rule if the difference is greater than or equal to 4%. I want the Conditional Format to check if the difference is greater than or equal to 4% and apply the other rules or if less than 4% to leave the format unchanged. Hope this makes sense,

    Kind regards
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Conditional Formatting based on percentage differences

    If I understand correctly the following rules for Red and Green, respectively, should give you the desired results:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Note that this assumes if D12 read HB B12 should fill green.
    Let us know if you have any questions.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft 365
    Posts
    13

    Re: Conditional Formatting based on percentage differences

    Thanks JeteMc - that worked as I wanted it to.

    Much appreciated.

    Ady

+ 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 Based on Dates &/or Percentage
    By mycon73 in forum Excel General
    Replies: 8
    Last Post: 09-04-2016, 10:22 AM
  2. [SOLVED] Conditional Formatting Comparing Cells Based on Percentage
    By Ksherer in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-08-2015, 08:05 AM
  3. [SOLVED] Conditional Formatting with Data Bars - Based on Completion Percentage
    By benwahchang in forum Excel General
    Replies: 9
    Last Post: 11-14-2014, 03:38 PM
  4. [SOLVED] Conditional Formatting based on percentage
    By Tobievr in forum Excel General
    Replies: 2
    Last Post: 10-05-2013, 07:02 AM
  5. Replies: 2
    Last Post: 02-26-2013, 03:47 AM
  6. Replies: 2
    Last Post: 01-10-2011, 03:29 PM
  7. Conditional formatting based on a percentage difference
    By Dan27 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-13-2010, 04:53 PM

Tags for this Thread

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