+ Reply to Thread
Results 1 to 3 of 3

Formatting According to Conditions

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Formatting According to Conditions

    Hi,

    In the attached file I have sample data in columns A to F and I would like to format the values in columns C to F based on two criteria:

    1. If the text in column B is "Percentile" then the adjacent numbers should be expressed to 0 decimal places and shaded according to the scheme shown in cells I5 to M5.

    2. If the text in column B is either "Absolute" or "Relative" then the adjacent numbers should be expressed to 2 decimal places and shaded according to the scheme shown in cells I3 to K3.

    I have formatted the data in columns C to E to show how I would expect the results to look.

    Can someone please suggest a solution.

    Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-27-2015
    Location
    Germany
    MS-Off Ver
    2007
    Posts
    4

    Re: Formatting According to Conditions

    Hey,

    I have added the conditional formatting (in Sheet2), you only need to add the rules for Absolute. They are the same as the rules for Percentile, just change "=(and($B2="Percentile"..." into =(and($B2="Absolute"..

    Let me know if you need any additional help with that.

    Julian

    Edit: damn i got the shading for "Absolute" wrong. Use FDibbins instructions below.
    And in addition to their instructions: to change the number of decimals displayed, when you change the format select the tab "Number" -> Number -> decimal places
    Attached Files Attached Files
    Last edited by unsuitable_; 10-16-2015 at 06:40 PM. Reason: changed the "$" in my post, but they are right in the file ;)

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Formatting According to Conditions

    1. highlight the range you want to apply the conditional formatting to (C2:F5 in your sample)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =AND($B2="percentile",C2<=25) format fill DK GREEN

    Repeat 3 and 4 with =AND($B2="percentile",C2>25) format Fille with LT GREEN
    Repeat 3 and 4 with =AND($B2="percentile",C2>50) format Fille with ORANGE
    Repeat 3 and 4 with =AND($B2="percentile",C2>75) format Fille with RED

    Repeat 3 and 4 with =AND($B2<>"percentile",C2>=0) format Fille with DK GREEN
    Repeat 3 and 4 with =AND($B2<>"percentile",C2<0) format Fille with RED
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. [SOLVED] Conditional formatting with more than 1 conditions
    By newtoexcel24 in forum Excel General
    Replies: 11
    Last Post: 06-28-2013, 04:28 AM
  2. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  3. formatting wth 3 conditions
    By lookingforanwers in forum Excel General
    Replies: 8
    Last Post: 05-24-2012, 01:51 PM
  4. Conditional Formatting with two Conditions
    By Madball in forum Excel General
    Replies: 8
    Last Post: 02-14-2012, 11:38 AM
  5. Conditional Formatting with more than 3 conditions
    By Sara_Chase in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-22-2006, 08:18 PM
  6. More than 3 conditions for formatting
    By nsv in forum Excel General
    Replies: 3
    Last Post: 03-08-2006, 10:23 AM
  7. conditional formatting with four conditions
    By Ring eye in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2006, 08:40 PM
  8. Conditional formatting wth more than 3 conditions
    By Sue in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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