+ Reply to Thread
Results 1 to 4 of 4

Match multiple columns TODAY()+1 problem

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    switzerland
    MS-Off Ver
    Excel 2010
    Posts
    38

    Match multiple columns TODAY()+1 problem

    Hi everyone

    I have the following problem that I am unable to understand and solve.

    I have a conditional formatting like this:

    =INDEX($B2:$Z2, MATCH(TODAY(), $B$1:$Z$1, 0)) = "x"

    If, e.g. the cell D20 displays an x AND the date in D1 is today's date, the function will color the cell in A20 red.
    This works perfect so far.
    The sheet contains:

    A1:A50 := cells to color
    B1:BXX1 := the dates
    B2:BXX50 := empty cells which may contain an x

    Now, I was thinking to make it a little more complex.

    I want that A20 turns red, only if there is an x in D20 and an x in D21. Meaning, an x for today and tomorrow.
    That is a problem of multiple columns that I tried to solve like this:

    =INDEX($B10:$Z10; MATCH(1; (TODAY() = $B$1:$Z$1)*(TODAY()+1 = $B$1:$Z$1); 0)) = ""

    If I delete the +1 the function works just fine.
    If I leave it there excel returns #N/A

    How could I solve this issue without implementing any VBA code?

    Thanks in advance

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Match multiple columns TODAY()+1 problem

    Do it like this:

    =AND(INDEX($B2:$Z2,MATCH(TODAY(),$B$1:$Z$1,0))="x",INDEX($B2:$Z2,MATCH(TODAY(),$B$1:$Z$1,0)+1)="x")

    although the Z should be BXX.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    switzerland
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Match multiple columns TODAY()+1 problem

    Ok, I see.

    It is best to work with AND here.
    Cool.

    Thanks for everything Pete, you have showed me a great deal of this tool in a very short time.

    Cheers

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Match multiple columns TODAY()+1 problem

    You use AND because there are two conditions, both of which have to be satisfied, i.e. x in today's cell AND x in tomorrow's cell.

    Pete

+ 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