+ Reply to Thread
Results 1 to 10 of 10

Conditional formatting not matching third criteria

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Conditional formatting not matching third criteria

    Col A shows the Equipment number, Col B the date rented out and Col C date returned.

    Cols I - S are the dates from 1 - 16 Jan.

    Conditional Formatting formula works perfectly in identifying the "date ranges", but posts them sequentially in the rows matching the dates in Cols A - C.
    =AND($B2<=I$1,$C2>=I$1)

    But when the Equipment is added, it doesn't work:
    =AND($A2=$H2,$B2<=I$1,$C2>=I$1)
    Correct location is shown by thick border around each bloc of cells.

    All solutions, suggestions and recommendations received gratefully as ever,

    Ochimus

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Conditional formatting not matching third criteria

    i think this will work
    =AND(INDEX($B:$B,MATCH($H2,$A:$A,0))<=I$1,INDEX($C:$C,MATCH($H2,$A:$A,0))>=I$1)
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting not matching third criteria

    $A2=$H2

    This conditions means "if the value in column A matches the value of column H in the same row." From what I can guess (there is no description of what you are trying to do) you really want to use the equipment number in column H and look up the data for that equipment in columns A:D.

    Change your formula for yellow formatting to:

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


    and it will match your blocks that say "S/be here"


    This will also mean that the extra condition you added is not necessary because the VLOOKUP already takes into account matching the equipment number.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting not matching third criteria

    I didn't preview before posting--etaf has essentially the same solution but uses INDEX/MATCH instead of VLOOKUP.

  5. #5
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Conditional formatting not matching third criteria

    Many thanks for the prompt responses which resolved what I posted but - as shown on the revised attachment - throws up a second issue.

    I assumed the formula would search and match every row where Col A matched the Equipment number, filling the relevant dates on the same row, so Equipment 1 would fill not only 5th - 7th as it does, but would also fill the second instance on 11th.

    As shown on the attached it fills only the first instance.

    Hope someone can see how to get round that?

    Ochimus

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Conditional formatting not matching third criteria

    How about
    =SUMPRODUCT((Equipment=$H2)*(From<=I$1)*(To>=I$1))

  7. #7
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Conditional formatting not matching third criteria

    More interesting by the minute!

    As you can see on the attached, SUMPRODUCT approach added the second rental to Equipment 1, but not to any others.

    Even tried adding different CFs to each Equipment row, and that didn't work.

    Ochimus

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Conditional formatting not matching third criteria

    You might want to check the dates that you have entered for the last to rows (the ones in blue)

  9. #9
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Conditional formatting not matching third criteria

    Fluff,

    Many thanks for seeing the error. Obviously should have stayed in bed today!

    Thanks to everyone who solved this for me. It's ridiculous when I can't resolve what should be simple!

    Will now mark this as Solved

    Ochimus

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Conditional formatting not matching third criteria

    Glad to help & thanks for the feedback

+ 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 with multiple/matching criteria.
    By gz3s36 in forum Excel General
    Replies: 7
    Last Post: 09-06-2017, 06:58 AM
  2. Conditional Formatting based on 2 matching criteria
    By mattsonberg in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-11-2016, 12:04 AM
  3. Conditional formatting: not matching
    By akkerstad in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-06-2014, 01:12 PM
  4. [SOLVED] Matching duplicates based on multiple criteria, conditional formatting?
    By Jaqjaq in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-23-2013, 02:42 PM
  5. [SOLVED] Count cells with date criteria matching conditional formatting colour
    By summer2010 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-07-2013, 04:34 AM
  6. Excel 2007 : matching cells with conditional formatting
    By strokedmaro in forum Excel General
    Replies: 2
    Last Post: 06-20-2010, 06:03 PM
  7. Conditional Formatting if Matching Set of Values
    By Niester Rabbit in forum Excel General
    Replies: 10
    Last Post: 06-08-2009, 02:55 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