+ Reply to Thread
Results 1 to 7 of 7

Conditional Formating based on another cells value containing text and digits

  1. #1
    Forum Contributor
    Join Date
    05-22-2012
    Location
    Boise, Idaho
    MS-Off Ver
    Office 365
    Posts
    156

    Conditional Formating based on another cells value containing text and digits

    Hello-- Using Excel 2007---2 questions--

    1st --I have a column of cells (column B) containing text and two digit numbers in the same cell. I want the column next to it (column A) to have a conditional format based on whether that 2nd column has a number within a specific range. Meaning if it has a number between 10 and 19 the first column will be green, if between 20 and 29 it will be red, if it has a value between 30 and 40 it is a blue.

    2nd--Is it possible to have the rule skip a number if it is followed by the word "egg" and only read the 2nd number for the conditional formatting rule?

    Here are some examples of the text and number in the second column.

    3 Split 15 Blast-(Column A Should be Green)
    4 Right 16 Blast-(Column A Should be Green)
    5 Split 23 Egg 16 Dive-(Column A Should be Green)
    6 Split 38 Egg Fly 23 Dive-(Column A Should be Red)
    7 Split 22 Dive 37 Egg-(Column A Should be Red)
    8 Split 33 Dive 28 Egg-(Column A Should be Blue)
    9 Split 33 Egg 28 Around-(Column A Should be Red)
    10 Twins R 37 Egg Fly 24 Dive-(Column A Should be Red)
    11 Split 23 Egg 30-R Flat-(Column A Should be Blue)

    Is this possible
    Last edited by mrteater; 05-13-2015 at 05:49 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Conditional Formating based on another cells value containing text and digits

    A few of those lines have more than one set of words and numbers..

    Which one matters?

    I have 9 minutes. We can do this!
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    05-22-2012
    Location
    Boise, Idaho
    MS-Off Ver
    Office 365
    Posts
    156

    Re: Conditional Formating based on another cells value containing text and digits

    The first column (A is just number 1,2,3,4 etc). Column B is the Key info that I need to determine the format in Column A. The info in parenthesis is just info on what color the format should be. Thanks your your help

    Split 15 Blast-(Column A Should be Green)
    Right 16 Blast-(Column A Should be Green)
    Split 23 Egg 16 Dive-(Column A Should be Green)
    Split 38 Egg Fly 23 Dive-(Column A Should be Red)
    Split 22 Dive 37 Egg-(Column A Should be Red)
    Split 33 Dive 28 Egg-(Column A Should be Blue)
    Split 33 Egg 28 Around-(Column A Should be Red)
    Twins R 37 Egg Fly 24 Dive-(Column A Should be Red)
    Split 23 Egg 30-R Flat-(Column A Should be Blue)

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Conditional Formating based on another cells value containing text and digits

    So "Split 38 Egg Fly 23" has 2 words and 2 sets of number. It is Red because 23 is in the red range. It could also be blue for having a number between 30 and 40 though.

    "Split 22 Dive 37 Egg" Also has 2 words and 2 sets of numbers. This one is also red, but the 2nd set of numbers is the one putting it in that category
    Last edited by daffodil11; 05-13-2015 at 06:04 PM.

  5. #5
    Forum Contributor
    Join Date
    05-22-2012
    Location
    Boise, Idaho
    MS-Off Ver
    Office 365
    Posts
    156

    Re: Conditional Formating based on another cells value containing text and digits

    Correct on the colors but let me add to your explanation. For the first one you mentioned "Split 38 Egg Fly 23"---It is red because 38 is followed by the word "egg" to 23 is the key number and numbers 20-29 are red. For the second one "Split 22 Dive 37 Egg"---Again you are correct it is red as the key number is 22 (20-29=red) and 37 is followed by "egg".
    Thanks

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Conditional Formating based on another cells value containing text and digits

    Totally doable it seems.

    Totally solved it and crashed Excel. Let me recreate.

    So depressing. It's huge.

  7. #7
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Conditional Formating based on another cells value containing text and digits

    Edit: Totally missed half the formula.

    Condition 1:
    =AND(SUMPRODUCT(MID(0&IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),LARGE(INDEX(ISNUMBER(--MID(IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)>=10,
    SUMPRODUCT(MID(0&IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),LARGE(INDEX(ISNUMBER(--MID(IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)<=19)

    Condition 2:
    =AND(SUMPRODUCT(MID(0&IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),LARGE(INDEX(ISNUMBER(--MID(IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)>=20,
    SUMPRODUCT(MID(0&IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),LARGE(INDEX(ISNUMBER(--MID(IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)<=29)

    Condition 3:
    =AND(SUMPRODUCT(MID(0&IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),LARGE(INDEX(ISNUMBER(--MID(IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)>=30,
    SUMPRODUCT(MID(0&IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),LARGE(INDEX(ISNUMBER(--MID(IFERROR(LEFT(B6,SEARCH(" Egg",B6)-4),B6)&IFERROR(MID(B6,SEARCH(" Egg",B6)+4,99),""),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)<=40)

    Attached example, because this got crazy complicated. This is how I like to finish a day.
    Attached Files Attached Files
    Last edited by daffodil11; 05-13-2015 at 06:49 PM.

+ 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 Formating based on Text Justificaiton
    By Dexterddog in forum Excel General
    Replies: 6
    Last Post: 08-15-2013, 02:46 PM
  2. [SOLVED] Conditional formating based on text in 2 columns (but only partial text!)
    By Icehockey44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2012, 06:26 AM
  3. Replies: 5
    Last Post: 07-12-2012, 05:38 PM
  4. Replies: 3
    Last Post: 08-28-2009, 11:16 AM
  5. Conditional formating based on text
    By mango7 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-08-2006, 06:11 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