Share via

Help with Excel /Xlookup and added Date criteria

Anonymous
2025-04-20T14:12:10+00:00

Hi all , many thanks for any help with this .

Im sure a relatively simple solution here I cannot find order for result in the formula .

Column "B" - a list of Dates

Column "D" - a list of Values / names

Xlookup formula to return date of 1st instance of specified Value "FOX". where "FOX" is value of cell F6.

=XLOOKUP($F$6,($D$9:$D$45),B9:B45,"----",0,1)

additionally another cell to return last instance of Value .

=XLOOKUP($F$6,($D$9:$D$45),B9:B45,"----",0,-1)

Any advice - to write format so that return array used / ie column "B" and return DATE is defined as only that greater than TODAY , and only dates of 1st / last instance after TODAY returned as result .

DD

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2025-04-20T23:01:56+00:00

    Hi,

    If the dates are sorted in ascending order, then these formulas will work

    =XLOOKUP(1,(($B$2:$B$17="Fox")*($A$2:$A$17>TODAY())),$A$2:$A$17)

    =XLOOKUP(1,(($B$2:$B$17="Fox")*($A$2:$A$17>TODAY())),$A$2:$A$17,,,-1)

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments
  2. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2025-04-21T23:03:26+00:00

    You are welcome. If my previous reply helped, please mark it as Answer.

    0 comments No comments
  3. Anonymous
    2025-04-21T14:09:03+00:00

    Works perfectly - thank you so much / and for quick replies

    0 comments No comments
  4. HansV 462.6K Reputation points MVP Volunteer Moderator
    2025-04-20T16:45:54+00:00

    =IFERROR(MINIFS($B$9:$B$45, $B$9:$B$45, ">"&TODAY(), $D$9:$D$45, F6), "")

    and

    =IFERROR(MAXIFS($B$9:$B$45, $B$9:$B$45, ">"&TODAY(), $D$9:$D$45, F6), "")

    0 comments No comments