+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting between a range of two named ranges

  1. #1
    Registered User
    Join Date
    12-18-2017
    Location
    Martinsburg, WV
    MS-Off Ver
    10
    Posts
    14

    Conditional Formatting between a range of two named ranges

    I want to apply formatting to cells based on two named ranges that contain a start and an end date.
    vOffSt and vOffEnd

    I compare those dates as follows to highlight the specific cell that match.
    So... any cell that matches vOffSt is handled and works perfectly with
    =SUMPRODUCT(--ISNUMBER(SEARCH(vOffSt,J11)))>0

    cells that match vOffEnd uses
    =SUMPRODUCT(--ISNUMBER(SEARCH(vOffSt,J11)))>0

    So if someone takes one day off, the cell highlights perfectly.
    What I need to do is highlight the range of cell's that fall between the vOffst start date and the vOffEnd end date.

    So somehow, I need to check the date in the cell to see if it is >= to the vOffSt date in the named range and if it is <= the vOffEnd date in that named range.
    I've tried to combine the two equations that work as
    =And(j11>=SUMPRODUCT(--ISNUMBER(SEARCH(vOffSt,J11)))>0, j11<=SUMPRODUCT(--ISNUMBER(SEARCH(vOffSt,J11)))>0)

    When I do that, it highlights every cell. I can't seem to figure out how to test the value in J11 first and then pass that to t he functions noted above.
    Do I need to change to a vLookup instead of search or something?

    Would appreciate any help.
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Conditional Formatting between a range of two named ranges

    Try this CF rule for the range $J$11:$P$16

    =SUMPRODUCT((vOffSt<=J11)*(vOffEnd>=J11))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    12-18-2017
    Location
    Martinsburg, WV
    MS-Off Ver
    10
    Posts
    14

    Re: Conditional Formatting between a range of two named ranges

    that worked perfectly... i don't understand it.. .but it works perfectly!!
    Thanks so very much!!

+ 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 with dynamic named ranges
    By jensslofstra in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-28-2018, 04:37 PM
  2. Syntax for Conditional formatting using named ranges
    By MKaprielian in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2015, 12:05 AM
  3. Conditional formatting using named ranges.
    By Turtleman10 in forum Excel General
    Replies: 0
    Last Post: 05-16-2013, 08:57 AM
  4. [SOLVED] Conditional formatting with named ranges, need help!
    By petelomax in forum Excel General
    Replies: 2
    Last Post: 04-27-2012, 06:30 AM
  5. [SOLVED] Conditional Formatting with Named Ranges
    By Revverend in forum Excel General
    Replies: 7
    Last Post: 04-02-2012, 05:31 AM
  6. conditional formatting based on 5 named ranges
    By dcgrove in forum Excel General
    Replies: 8
    Last Post: 01-06-2010, 06:10 PM
  7. Conditional Formatting to HIghlight named ranges - error
    By Malte Nuhn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2005, 05:05 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