+ Reply to Thread
Results 1 to 15 of 15

Color Coding Based on Another Cell Content and Copy Conditional Format

  1. #1
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Color Coding Based on Another Cell Content and Copy Conditional Format

    Hi guys, I need to do a couple of things with my excel spreadsheet.

    First of all I have to color a matrix of cells based on the content of another cell.
    After I did that I want to reproduce, the matrix and the conditional format, based on another one cell, without do all the work again.
    Since I understand my english is terrible, I included an example spreadsheet with the instructions.

    I apologize for my language
    Best
    Matthew
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Mathew,

    1st of all your English is excellent :-)

    To answer your question:

    You could use conditional formatting.

    Example: Select one of your two table Ranges - in the - Home Tab, Go to CF, Highlight cell rules, Text that equals. In the box type A & leave the formatting as Red with Dark Lettering. Do the same for D & E but change the formatting if you need to.

    Mathew, 1 ° di tutte le vostre è eccellente :-) Per rispondere alla tua domanda: È possibile utilizzare la formattazione condizionale. Esempio: Selezionare uno dei vostri intervalli di due tabelle - in - Home scheda, vai a CF, evidenziare le regole delle cellule, testo che è uguale. Nella casella digitare un lasciare la formattazione come rosso con Lettering scuro. Fare lo stesso per D E ma modificare la formattazione, se è necessario.
    Last edited by BlindAlley; 03-27-2016 at 01:33 PM.

  3. #3
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Unfortunately that's not going to help but ty a lot for your time anyway

    What you are suggesting to do is to conditional formatting a cell based on its value, while I need to format it based on another one.
    Also another problem I'm going to have is to reproduce the conditional format. When you copy and paste a cell in excel, by defaul, the formatting, is going to be the same, along with the condition of color format. The problem is that conditional formatting is going to be based on the old expressions

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,702

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Try ..

    as CF rule..

    =OR(E6=LEFT($O$2,1),E6=MID($O$2,3,1),E6=RIGHT($O$2,1))

  5. #5
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Hi, ty for stopping by.
    Well, I tried on the example spreadsheet and it works, however, it was semplification of the real sheet and on it, it doesnt' work.
    What I find that it isn't working is with 2 letter string.

    I've included the real spreadsheet so you can figure out why it isn't working. Sorry for taking your time again
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,702

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    I split the string into individual cells

    then used

    =OR(T5=$BG$4,T5=$BH$4,T5=$BI$4,T5=$BJ$4,T5=$BK$4,T5=$BL$4)

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

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Quote Originally Posted by JohnTopley View Post
    =OR(T5=$BG$4,T5=$BH$4,T5=$BI$4,T5=$BJ$4,T5=$BK$4,T5=$BL$4)
    A bit shorter...

    =COUNTIF($BG$4:$BL$4,T5)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Quote Originally Posted by Tony Valko View Post
    A bit shorter...

    =COUNTIF($BG$4:$BL$4,T5)
    Even shorter...

    =OR($BG$4:$BL$4=T5)

    As a CF formula rule it will automatically be evaluated as an array.

  9. #9
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Clearly I am retarded... I can't get that working.
    I selected the matrix and then input the conditional format rule, but doesn't work

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,702

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Tony's formula works fine.

    However, note that the numbers 22, 33, 99 are TEXT in your (red) matrix so ensure they are text in the individual cells that contains your parameters (BG4 to BL4)

  11. #11
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    I want to apologize first, since I'm more than sure you have dealt with this kind of stupid questions before.

    If I'm understanding right, I have to split the string into individual cells and I did that but the red matrix didn't change its colors.
    Can you edit my example spreadsheet in order do see what I'm doing wrong?

    Also I want to point out a thing, the string which I based my color coding is changing in lenght, so I can't split its content everytime. Much of the times I have a very long string so it's pretty akward to do it, any workaround for this?

    Again ty for your kind help

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,702

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    See attached:

    in BG4

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE($BF$4," ",""),",",REPT(" ",99)),(COLUMNS($A:A)-1)*99+1,99))

    Copy across row

    Changes to Bf4 should be reflected in the row

    I copied to CZ4 and named the range "CF_Rng" then used Tony's formula

    =OR(CF_rng=T5)
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Ty a lot, your solution is great, a couple of probably stupid questions

    1. How can I add more columns to the expression? I need 169 at maximum. Should I change the original formula:
    =TRIM(MID(SUBSTITUTE(SUBSTITUTE($BF$4," ",""),",",REPT(" ",99)),(COLUMNS($A:A)-1)*99+1,99))
    in
    =TRIM(MID(SUBSTITUTE(SUBSTITUTE($BF$4," ",""),",",REPT(" ",169)),(COLUMNS($A:A)-1)*168+1,169))
    ?
    Right now I copied the formula across the row including more cells, but I don't know whether I should change those numbers


    2. =OR(CF_rng=T5)
    I made a custom range named 'porco' after that I modify the expression to =OR(porco=AK10) in order to color another table, but it doesn't work.
    Instead if I use the expression =OR(porco=T5) works, I don't understand why, what is T5?

    See the update spreadsheet
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,702

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    T5 is the cell (top left) of the "re" matrix: the CF refers to all of that matrix.

    If (as you do) want to CF all the matrices , then you will have do added each matrix to the "Applies to" part of CF

    e.g. =$T$5:$AF$17,$C$12:$O$24

    Repeat for each matrix.

    If you have 169 (!!!) then Cf_rng will need to extended to ??4 where ?? is the169th cell from BG4 ( .... HS4 I believe)

    the 99 has nothing to with the number of characters ; you will need to try it with 169 characters !!!!

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE($BF$4," ",""),",",REPT(" ",99)),(COLUMNS($A:A)-1)*99+1,99))

    Attached appears to work OK.
    Attached Files Attached Files
    Last edited by JohnTopley; 03-28-2016 at 02:16 PM.

  15. #15
    Registered User
    Join Date
    11-05-2013
    Location
    Italy
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Color Coding Based on Another Cell Content and Copy Conditional Format

    Ty a lot for your work, I'll try it as soon sa I get home

+ 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: 8
    Last Post: 06-27-2015, 03:21 PM
  2. color coding based on color in another cell
    By dbasch89 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-08-2014, 05:57 PM
  3. Count / Sum based on Background Color with Manual and Conditional Format Color
    By sam99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2014, 08:00 PM
  4. Replies: 5
    Last Post: 10-24-2013, 05:34 PM
  5. Conditional format to change color of row based on data in cell
    By PJenkins in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-02-2013, 09:39 AM
  6. [SOLVED] Change conditional format (color) of a cell based on another celll (Excel 2010)
    By ffnptown in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-28-2012, 09:50 PM
  7. [SOLVED] Conditional Formatting, current cell color follows to diff cell based on content
    By iallenwood in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2012, 04: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