+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting gradient based on frequency of text entries

  1. #1
    Registered User
    Join Date
    04-21-2015
    Location
    Vancouver, BC
    MS-Off Ver
    2019
    Posts
    13

    Conditional formatting gradient based on frequency of text entries

    I'd like to apply a color gradient to a range of cells based on the number of times a text value appears in that range. For example:

    Burn
    Burn
    Sprain
    Laceration
    Burn
    Sprain

    'Burn' appears the most, so it would appear red in the standard gradient pattern. Laceration only appears once, so it would be green. Values that appear more or less frequently would appear in varying shades from green through yellow to red.

    Right now I have a separate table under my data with a COUNTIF function used to apply the colors, but I'd like to put the formatting into the main table using a conditional formula that does the math and applies the color gradient. I've viewed another thread where individual colors were assigned based on discrete frequencies, but that seems a little awkward when I'd have to add another formula every time an entry appears more frequently than the previous maximum number.

    Can Excel do this?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,431

    Re: Conditional formatting gradient based on frequency of text entries

    Just use your COUNTIF formula for a helper column next to the list of colours and use that for the conditional formatting.

    Excel 2016 (Windows) 32 bit
    F
    G
    2
    red
    3
    3
    green
    2
    4
    blue
    1
    5
    red
    3
    6
    red
    3
    7
    green
    2
    Sheet: Sheet1
    Last edited by AliGW; 08-09-2018 at 01:10 PM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-21-2015
    Location
    Vancouver, BC
    MS-Off Ver
    2019
    Posts
    13

    Re: Conditional formatting gradient based on frequency of text entries

    Thanks. Is that as close as I can get to what I want to do?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,431

    Re: Conditional formatting gradient based on frequency of text entries

    Probably not, although perhaps you need to mock up what exactly you want it to look like. I wasn't going to spend hours refining it in case it wasn't what you wanted - I am showing you want can be done in principle.

  5. #5
    Registered User
    Join Date
    04-21-2015
    Location
    Vancouver, BC
    MS-Off Ver
    2019
    Posts
    13

    Re: Conditional formatting gradient based on frequency of text entries

    What I want is basically what you showed, but with the colors applied to the text column, not the numbers. So in the screenshot below, the colors would appear in column A, with no need to have column B.
    Excel frequency formatting.jpg

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,431

    Re: Conditional formatting gradient based on frequency of text entries

    That's going to be tricky without VBA because colour scales only work on the range with the numbers. Someone might know a sneaky workaround.

+ 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. Replies: 1
    Last Post: 07-22-2018, 07:09 AM
  2. [SOLVED] Conditional formatting based on frequency of text values
    By jveleke in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-19-2017, 09:29 PM
  3. VBA Conditional Formatting with Gradient Fill
    By dabaron in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2016, 12:32 PM
  4. Replies: 1
    Last Post: 07-22-2014, 03:01 AM
  5. Excel 2007 : Conditional formatting according to frequency
    By loriandrico in forum Excel General
    Replies: 3
    Last Post: 01-20-2012, 10:11 AM
  6. Gradient Filling in Conditional Formatting
    By Tommy1005 in forum Excel General
    Replies: 0
    Last Post: 02-21-2011, 11:43 AM
  7. Replies: 6
    Last Post: 05-17-2007, 07:08 AM

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