+ Reply to Thread
Results 1 to 9 of 9

Conditional formatting that will reference entire table, not just first row.

  1. #1
    Registered User
    Join Date
    05-10-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Conditional formatting that will reference entire table, not just first row.

    I have attached an example spreadsheet for reference:

    I am essentially trying to create a gantt chart within the cells where table 1 corresponds to row 3 and table 2 to row 4. I want the conditional formatting to reference all rows in a table instead of just the first. My conditional formatting formula is currently:

    =AND($AP3="Greenbrier",AND(B$2>=$AN3,B$2<=$AO3))

    where it is searching for "Greenbirier" text in the AP column, and coloring the range defined by columns AN and AO appropriately.

    As of now, creating the chart would require me to have way too many rules (12 areas*14 rows in table)

    ex)

    =AND($AP3="Greenbrier",AND(B$2>=$AN3,B$2<=$AO3))

    =AND($AP4="Greenbrier",AND(B$2>=$AN4,B$2<=$AO4))

    =AND($AP5="Greenbrier",AND(B$2>=$AN5,B$2<=$AO5)) ....etc


    I have been trying to create a formula that would reference the entire table, something like:

    =AND($AP$3:$AP$16="Ohio",AND(B$2>=$AN$3:$AN$16,B$2<=$AO$3:$AO$16))

    which would enable me to have 12 rules per table, but have had no luck.

    I welcome any ideas regarding ways to re-write my formula to make this happen.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional formatting that will reference entire table, not just first row.

    I think it's just a matter of adjusting your "Applies to" ranges in the Conditional Formatting Manager to include entire table.

    so instead of =$B$3:$AL$3, you would apply to =$B$3:$AL$16 the formula remains untouched.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-10-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Conditional formatting that will reference entire table, not just first row.

    Thanks NBVC,

    I think that changing the "applies to" ranges would apply the formatting to that range, but still wouldn't be referencing the table range that I want. For table one, that range would be AM3:AP16.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional formatting that will reference entire table, not just first row.

    Are you looking for something like the attached?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-10-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Conditional formatting that will reference entire table, not just first row.

    Unfortunately, I am not. I am guessing that you selected row 3 within the date range and dragged it down. What I need is all of the data in table 1 to plot on row3, and all of the data on table 2 to plot on row 4. I have colored in row 4 to represent how I want it to format. Eventually, I am going to have about 14 tables that will be changing weekly, so I want this process to be automated. I have been experimenting with index and vlookup functions, but still no dice.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-10-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Conditional formatting that will reference entire table, not just first row.

    Still hunting for a solution

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Conditional formatting that will reference entire table, not just first row.

    I think I have a working solution, but it doesn't seem to be efficient as it is taxing on the workbook..

    Basically I removed all your formatting, select B3:AL23 and then apply conditional formatting:

    I renamed your tables Table1 and Table2 to match your column A codes...

    =INDEX(INDIRECT("Table"&$A3),MATCH(1,INDEX((INDEX(INDIRECT("Table"&$A3),0,2)<=B$2)*(INDEX(INDIRECT("Table"&$A3),0,3)>=B$2),0),0),4)="Greenbrier"

    and applying the corresponding colour,

    Then using same formula for each city/colour to get 12 total...

    But this is hard on the sheet. You can test if you want...

    I am not sure of an easier way... maybe VBA? (which is not my expertise, though).

  8. #8
    Registered User
    Join Date
    05-10-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Conditional formatting that will reference entire table, not just first row.

    Thanks NBVC,

    Are you able to attach the file containing the functioning work that you did?

  9. #9
    Registered User
    Join Date
    05-10-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Conditional formatting that will reference entire table, not just first row.

    NBVC,

    Please disregard my previous post, I have gotten it to work. So far, this appears to function way better than I had anticipated, with far less rules than expected. I thought I would need at least 12 per table, but now it looks like just 12 for the whole workbook. As of now, I can declare this issue solved.

    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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