+ Reply to Thread
Results 1 to 15 of 15

Conditional formatting for non-alphabetic data

  1. #1
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Question Conditional formatting for non-alphabetic data

    Hi there,

    I have managed to sort some data according to non-alphabetical criteria. Specifically, I have sorted a range of data for children's attainment levels where 4E (year 4 emerging) comes before 4D (year 4 developing), which comes before 4S (year 4 secure), etc. So I have used 'Custom List' to insert the levels, like this: 3E, 3D, 3S, 4E, 4D, 4S.

    Is there a way to use the same principle in conditional formatting? For example, if column B has data for each child for July and column C has data for September, I'd like Excel to highlight in column C the levels that have gone down (e.g. from 3S to 3D), the ones that have stayed the same, and the ones that have improved (e.g. from 3S to 4E).

    Thank you in advance.

    All the best,

    David

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional formatting for non-alphabetic data

    So if you have your levels written in a range, and sorted, then you can use the Match function to get a numerical value for a given level.
    Then you can use standard If x>y type of functions..

    Example
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Re: Conditional formatting for non-alphabetic data

    Thank you for your reply. I have (as I should've done in the first place!) attached an example of what I mean. I would like to see if the levels for each child are better than, worse than, or the same as, in September compared to July.
    I'd like to highlight, in column C, any levels that are higher to be green, the same in yellow, and worse in red. Does the attachment help you figure out how to do what I'm asking?

    Your help is much appreciated!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional formatting for non-alphabetic data

    It's not clear which levels are Higher than others.

    Your sheet will need to include a list of all the levels, sorted in Descending order (Highest level on top, lowest on bottom)
    Let's say that list is in H2:H7

    Higher:
    =MATCH(C2,$H$2:$H$7,0) < MATCH(B2,$H$2:$H$7,0)
    Lower:
    =MATCH(C2,$H$2:$H$7,0) > MATCH(B2,$H$2:$H$7,0)
    Same:
    =MATCH(C2,$H$2:$H$7,0) = MATCH(B2,$H$2:$H$7,0)

  5. #5
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Question Re: Conditional formatting for non-alphabetic data

    It's kind of what I want, but not quite. Please forgive me for not understanding - I wouldn't consider myself an advanced user of Excel.

    3E (year 3 emerging) is lower than 3D (year 3 developing), which is lower than 3S (year 3 secure).

    I've attached a new Excel file that is how I want it to end up looking. (I have changed the fill colours manually.) Hopefully that will help!

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional formatting for non-alphabetic data

    You will need to 'CREATE' a list that has all the levels sorted in order, either from Highest to Lowest, or Lowest to Highest.
    And that list needs to be written in a range of cells on your sheet.

  7. #7
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Re: Conditional formatting for non-alphabetic data

    Okay, I have sorted the data now, using the own list I created. (See attached.) How do I now get Excel to colour the boxes according to who has gone backwards (red), who's stayed the same (yellow) and who's improved (green)?

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional formatting for non-alphabetic data

    I don't see a list anywhere that tells me which level code is higher or lower than the others..

    Please create this list, and physically write it in a range of cells in your sheet. Similar to how I did in post #2.

  9. #9
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Re: Conditional formatting for non-alphabetic data

    Okay, I have now done that and attached the file.

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional formatting for non-alphabetic data

    OK, great.

    So now you make 3 conditional formatting rules.

    Set for Color Yellow
    =MATCH(C2,$E$2:$E$7,0) = MATCH(B2,$E$2:$E$7,0)

    Set for Color Green
    =MATCH(C2,$E$2:$E$7,0) > MATCH(B2,$E$2:$E$7,0)

    And for Colo Red
    =MATCH(C2,$E$2:$E$7,0) < MATCH(B2,$E$2:$E$7,0)

  11. #11
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Re: Conditional formatting for non-alphabetic data

    I have no idea what the formula actually means, or why it works, but it works! Thank you so much for your help and patience.

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Conditional formatting for non-alphabetic data

    You're welcome.

    Match finds the value of C2 within the Range E2:E7. And returns a number representing the position where it was found in that range.
    So if C2 was found in say E4, then Match returns 3 because E4 is the 3rd position in E2:E7 (E2 is 1st, E3 is 2nd, E4 is 3rd)

    It then does the same for B2 and compares the 2 results.
    Which one is larger, or are they the same..

  13. #13
    Registered User
    Join Date
    07-24-2017
    Location
    London
    MS-Off Ver
    MS Office 2016
    Posts
    7

    Re: Conditional formatting for non-alphabetic data

    Thank you for the explanation.

  14. #14
    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,731

    Re: Conditional formatting for non-alphabetic data

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

  15. #15
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Conditional formatting for non-alphabetic data

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

+ 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: 2
    Last Post: 10-22-2015, 04:18 PM
  2. Conditional Formatting or Data Validation for 1 cell based on another but limited data?
    By ExcelBeginner326 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2015, 01:25 PM
  3. [SOLVED] Create an Alphabetic List Based on Data in a Worksheet
    By rstringer in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-14-2014, 08:44 AM
  4. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  5. [SOLVED] Conditional formatting using Icon sets (comparing data to data in array)
    By darth.dims in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-27-2012, 05:36 AM
  6. Sorting Data by Time name BUT no Alphabetic Order
    By JRayhan in forum Excel General
    Replies: 2
    Last Post: 12-12-2012, 04:54 PM
  7. Conditional Formatting that will display conditional data
    By BrainFart in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2005, 01:05 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