+ Reply to Thread
Results 1 to 15 of 15

Conditional Formatting Based on Multiple Text Values

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Conditional Formatting Based on Multiple Text Values

    Hi everyone,

    I'm new to the forum and have been searching around for a way to color cells based on a range of text. For example, I would like to enter a number of cities in a column and based on the region they are in the cell color would change. So, if I entered Chicago, Boston or New York those cells would be blue. If I entered Los Angeles, California or San Jose, the cells would turn red. I don't want to enter another column for region and I don't know macros and all that. I do know a little about the rules within the conditional formatting. I figured out how to make a cell color change for one city but I don't to make 50 rules when I could do 4. Is there a way to make a formula within the rule to capture for a range of cities that would change to one color?

    Please be specific as I am not a pro when it comes to the formulas.

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: Conditional Formatting Based on Multiple Text Values

    The only way I can see this working is if you have a separate table with the cities and whichever region they are in. For example, your table might look like this

    City Region
    LA 1
    San Jose 1

    etc.

    And then you can use a lookup value to determine the formatting

    Edit: Actually I lied. Assuming the city is in column A, starting at A2, you could have a rule using a formula like =OR(A2="Los Angeles",A2="San Jose"... etc)

  3. #3
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional Formatting Based on Multiple Text Values

    OK if I use the Conditional formatting in the ribbon the formula doesn't work. I can apply to an empty cell referencing the other cells but I get a true/false return, not a color change.

  4. #4
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: Conditional Formatting Based on Multiple Text Values

    Hi Butman,

    Can you upload an example of your workbook?

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional Formatting Based on Multiple Text Values

    Here it is cffndncr. Notice that I went in and made rules for each city since I can't figure it out. I tried to make a list on the second sheet of the cities that fall into a region (not up-to-date at the moment). Think of it as a radius. Cities that are closest are green (very close), then blue (a little travel but OK), then orange (not desired but doable), then red (not possible). Feel free to dump the rules in favour of four. As the list grows it's likely that more cities will need to be added and require more rules - rather tedious.

    Thanks

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional Formatting Based on Multiple Text Values

    Highlight your range and use this(for blue color. same for the others) in CF rules.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    How can you use Conditional Formating.

    --In Excel 2007 and 2010, Conditional Formatting is in the Styles group on the Home tab. In Excel 2003, Conditional Formatting is on the Format menu. See here how you can work using CF.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional Formatting Based on Multiple Text Values

    Sorry, forgot to upload and I can't do it in edit mode...

    Hope this works

    Electrical Companies.xlsx

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional Formatting Based on Multiple Text Values

    Seems that you compltely ignored my suggestion. Never mind!

    Here is your solution.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional Formatting Based on Multiple Text Values

    Hi Fotis1991,

    Sorry, somehow my edited post came in after your input. I hadn't seen it yet. Thanks for uploading a sample file. I will check it out and get back to you - much appreciated!

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Conditional Formatting Based on Multiple Text Values

    As you have a list of cities for each region just name those lists (right-click, define name), e.g. Region1, Region2 etc. Then you can use this formula in conditional formatting

    =MATCH(C2,Region1,0)

    add required format and repeat for the other 3 regions.

    In that way you never have to change conditional formatting - if you want to change, add or delete cities just change the lists accordingly
    Audere est facere

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional Formatting Based on Multiple Text Values

    Quote Originally Posted by Butman View Post
    Hi everyone,
    I don't want to enter another column for region and I don't know macros and all that.

    Thanks in advance
    I did my suggestion based in the bold part of your question.

    I agree that is better to use named ranges but in this case i would use the COUNTIF formula like this.

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

  12. #12
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: Conditional Formatting Based on Multiple Text Values

    Hi Butman,

    Sorry, I have been MIA over the weekend!

    Daddylonglegs pretty much outlined what I was suggesting. I have attached a sample of how this would work. You add the city and the region to the 'region' tab, and the conditional formatting on the main sheet will adjust accordingly.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional Formatting Based on Multiple Text Values

    Hi everyone,

    Thanks for your input.

    Fotis1991: thanks for uploading an excel file. I used your formulas, modified them and everything worked great. What I would like now is a way to simply update the Region tab (no. 2) and have it apply to tab 1 so I don't have to go in and modify formulas.

    Daddylonglegs / Cffndncr: I liked your suggestions but I couldn't modify the Region tab in the excel Cffndncr uploaded. Obviously, I'm doing something wrong. I have uploaded version 1 thanks to Fotis1991. version 2 is the one I need help with. Also, is there a way to do away with the region number in B column of Region tab? If you look at version 1, you will see how I would prefer to have regions laid out. I've heard of naming a group of cells. Maybe that's the key to this all.

    Electrical Companies V1.xlsxElectrical Companies V2.xlsx

  14. #14
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    170

    Re: Conditional Formatting Based on Multiple Text Values

    Hi Butman,

    I'm not sure why you couldn't change the region tab. Did you enable editing?

  15. #15
    Registered User
    Join Date
    03-14-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional Formatting Based on Multiple Text Values

    Man, I just looked at it again and now I get it. I changed the rules slightly when I shouldn't have. I simply added cities in tab 2 and it works. I didn't really want the extra region column in there but at least I know how it works (although I don't fully understand what's going on in the formulas.


    OK, now I'm trying to do the same thing in tab 1, column 2. I wanted text that was NOT "ON" to be red but it's not working (it's the last rule in the CF manager.
    Attached Files Attached Files

+ 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 based on multiple values in table
    By jcox1953 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-09-2014, 07:30 PM
  2. Conditional formatting with multiple text values
    By woodruff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-26-2013, 10:23 AM
  3. conditional formatting based on a series of column text values
    By stewphil in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-19-2012, 03:34 AM
  4. [SOLVED] Conditional Formatting Multiple Text Values
    By Graham Taylor in forum Excel General
    Replies: 3
    Last Post: 06-04-2012, 04:39 PM
  5. Conditional formatting based on text values.
    By jad70 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-09-2009, 12:13 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