+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting with offset

  1. #1
    Registered User
    Join Date
    09-17-2019
    Location
    USA
    MS-Off Ver
    16.0.11328 32bit
    Posts
    8

    Conditional formatting with offset

    Hello,

    I have a named range in my worksheet. which spans roughly ("B2:AB2000")
    within this range are single text words ie: Rent, Property, Signage. etc.

    Ive created formatting rules for each word, filling the cell with a unique color, using: Conditional Formatting / New Rule / Format only cells that contain / Format cells with specific text.

    How can i offset their color formatting 10 cells to the left, instead of appearing directly on each word.

    Thanks

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Conditional formatting with offset

    Select your range, B2:AB2000. Then, instead of using the 'Format only cells that contain' option, use 'Use a formula to determine which cells to format' and put this formula below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I used L2, since that is 10 columns to the right of column B, your first column. After applying the conditional formatting, if cell N5 contained the word Rent, then cell D5 would be shaded the color you chose in CF. Note that if one of those words exists in a column before K, nothing will be formatted because 10 columns to the left of J doesn't exist.

  3. #3
    Registered User
    Join Date
    09-17-2019
    Location
    USA
    MS-Off Ver
    16.0.11328 32bit
    Posts
    8

    Re: Conditional formatting with offset

    Thanks Paul..

    It works great!

    But im running into a problem where the Conditional Formatting doesn't hold to the cell.

    If a specific word is in say, F20, and i have its color offset 3 cells to the right at C20. When I move that colored cell( C20), it also moves the color along with it. Not sure why this would happen, as it should be referencing the initial offset code.

    Is there a way around this?, or perhaps a refresh option? Ive tried F2+Enter which doesn't work.

    thanks!

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Conditional formatting with offset

    The quick answer is to not move cells, as the cell properties get moved along with it. If you do that, then go into the Conditional Formatting screen to Manage Rules, then select 'This Worksheet' at the top (to see all rules), you'll notice that there is now an additional rule that applies just to that new cell location, and the main CF formula now 'Applies To' a convoluted range that excludes the original cell.

    So originally you had one rule [=OR(E2="Rent",E2="Signage",E2="Property")] with an 'Applies To' of [=$B$2:$AB$2000].

    If you drag C3 to D9, a new rule gets created that refers back to the original cell's offset (F3) and only applies to $D$9. The original rule still exists, but now applies to all cells in $B$2:$AB$2000 *except* cell D9. (Applies To: =$B$2:$AB$2,$B$4:$AB$8,$D$3:$AB$3,$B$10:$AB$30,$B$9:$C$9,$E$9:$AB$9,$B$3)

    So unless there's another way, after moving a cell you'd need to modify the original CF rule to apply to the correct range again (=$B$2:$AB$2000) and delete the single-cell rule.

  5. #5
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Conditional formatting with offset

    Thanks for the detailed explanation, Paul

    Didn't realize that about Conditional formatting with an offset. I guess it may not work for my needs. I'll try another approach.

    Many thanks!

+ 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 Formatting of cell value with an offset
    By JoshWinks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2019, 07:14 PM
  2. [SOLVED] VBA Conditional formatting with cell offset
    By Tanabar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2014, 03:23 PM
  3. [SOLVED] Conditional Formatting Offset
    By tommy_m in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2012, 04:41 PM
  4. Conditional formatting for percent is offset
    By danl1952 in forum Excel General
    Replies: 2
    Last Post: 07-14-2012, 09:52 AM
  5. Offset in conditional formatting
    By Diddy in forum Excel General
    Replies: 1
    Last Post: 03-27-2011, 12:07 PM
  6. Offset conditional formatting
    By Ducatisto in forum Excel General
    Replies: 7
    Last Post: 10-03-2008, 03:55 AM
  7. Conditional Formatting - offset ?
    By HUMBERTDING in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-09-2008, 05:32 AM

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