+ Reply to Thread
Results 1 to 13 of 13

Can I use conditional formatting for none numeric data?

  1. #1
    Registered User
    Join Date
    10-23-2015
    Location
    South West, England
    MS-Off Ver
    2010
    Posts
    4

    Can I use conditional formatting for none numeric data?

    I'm working on a school sheet that records students predicted grades against their target grades for their GCSEs. They have a column for their target grade (A* to G) then an adjacent column into which their teacher puts their projected grade. I want to be able to colour the projected grade column red if they are below target and green if they are on or above target. There are several hundred individual grades, so other than doing each one individually is there a general formula I can use?

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Can I use conditional formatting for none numeric data?

    Hi, welcome to the forum.

    See the attached file for one way to get this to work: CF for Target v Projected grades _ for helencj.xlsx

    It contains a list of grades in column E matched to numbers in column F (A* = 8, A = 7, etc). The target grades are in column A and projected grades in column B. The grades in Column B were selected, then 'Conditional Formatting' was clicked, 'New Rule' selected, then 'Use a formula to determine which cells to format'. This formula was then put in the formula box, with a red fill applied using the 'Format' button:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The same was then done with this formula with a green fill:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I hope that makes sense so you can apply it to your own file.

    ps If it were me, I'd use another colour (blue?) for projected grades above target, from the green colour for on target - but maybe that's just me...
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  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
    53,048

    Re: Can I use conditional formatting for none numeric data?

    On it's own, excel does not know that A > B, or F < D - I am assuming this is kind of what you are looking for?

    If so, we can add a small table that gives each letter a "score" A-G = 1-7, for instance, then use a vlookup into that table to test for <= target

    Edit: I see that Aardigspook has the same idea
    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

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Can I use conditional formatting for none numeric data?

    Or try to convert "A" .."G" in 6 downto 0 with
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    or 0 to 6
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Can I use conditional formatting for none numeric data?

    Select rProjected range, open CF and use it for:
    RED: =IF(CODE(B2)>CODE(A2),1,0)
    GREEN: =IF(CODE(B2)<=CODE(A2),1,0)
    where A2 Target, B2 Projected

    No additional columns or tables


    If you want more, check here
    Last edited by sandy666; 10-23-2015 at 08:25 PM.

  6. #6
    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
    53,048

    Re: Can I use conditional formatting for none numeric data?

    Sandy, that was a REALLY slick way of doing that, well done!!

    1 small addition would be to test for either UPPER or LOWER (doesnt matter which) on the grades...a < B, so that would cover someone entering lower case grade against an upper case target

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Can I use conditional formatting for none numeric data?

    No problem:
    RED: =IF(CODE(UPPER(B2))>CODE(UPPER(A2)),1,0)
    GREEN: =IF(CODE(UPPER(B2))<=CODE(UPPER(A2)),1,0)


    edit:
    Thanks for rep, Ford

    Additionally against numbers:
    YELLOW:=ISNUMBER(A2) with range An:Bm (e.g. A2:B50)
    hope it will be exhaustive solution

    of course DataValidation can be used or any other method.
    Last edited by sandy666; 10-23-2015 at 08:35 PM. Reason: too late to be wise :)

  8. #8
    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
    53,048

    Re: Can I use conditional formatting for none numeric data?

    Nicely done

  9. #9
    Registered User
    Join Date
    10-23-2015
    Location
    South West, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Can I use conditional formatting for none numeric data?

    Wow, thank you for all the fantastic replies! I am a complete noob at this and learned loads just by reading all your answers. I used Sandy's solution and added in an extra line to make them blue if they are above target (thank you for the suggestion.

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Can I use conditional formatting for none numeric data?

    You are welcome and thanks for the rep

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can I use conditional formatting for none numeric data?

    Quote Originally Posted by sandy666 View Post
    RED: =IF(CODE(UPPER(B2))>CODE(UPPER(A2)),1,0)
    GREEN: =IF(CODE(UPPER(B2))<=CODE(UPPER(A2)),1,0)
    If those are being used in conditional formatting you don't need the IF function:

    =CODE(UPPER(B2))>CODE(UPPER(A2))

    =CODE(UPPER(B2))<=CODE(UPPER(A2))

    In conditional formatting the format will be applied if the formula returns either TRUE or any number other than 0.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  12. #12
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Can I use conditional formatting for none numeric data?

    @helencj
    You're welcome and thanks for the rep. Sorry I haven't replied earlier, but I seemed to have some problems accessing the site.

    @sandy666
    Very clever - I never even thought of CODE. Have some rep

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Can I use conditional formatting for none numeric data?

    Thank you, Aardigspook

+ 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. 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
  2. [SOLVED] Extracting only numeric data from combined numeric & non-numeric data
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-20-2013, 11:51 AM
  3. Conditional Formatting Pie Charts (non-numeric values)
    By Redjewel in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 08-15-2013, 08:49 PM
  4. [SOLVED] Conditional formatting based on a text and a numeric condition
    By coolshooter in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2012, 02:56 AM
  5. [SOLVED] From alfa numeric data, substitute numeric data.
    By manharji in forum Excel General
    Replies: 6
    Last Post: 04-06-2012, 10:49 PM
  6. [SOLVED] Conditional Formatting that will display conditional data
    By BrainFart in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2005, 01:05 PM
  7. [SOLVED] conditional numeric formatting
    By fichtnerbass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2005, 01:06 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