Xlookup to with multiple conditions

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I use Xlookup to get the dates for my details tab. However, I need to refine the formula to get only today and any future dates, without getting old dates or even the dates that is formatted as 1/0/1900. Below is my sample data along with the formula that I'm using. Is there any suggestion to refine my formula to get the desired results?
Thanks!

Xlookup Help with dates criteria.xlsx
ABCDEFGHIJKLMNO
1Current ResultDesired ResultsIDsDates
2IDsNameDatesIDsNameDatesAAA
3AAAJohn10/3/2024AAAJohn10/3/2024BBB3/3/2024
4BBBWill9/3/2024BBBWill9/3/2024CCC9/7/2024
5CCCAbbey9/7/2024CCCAbbey9/7/2024DDD########
6DDDDon11/4/2021HHHLeo5/1/2024EEE
7EEELouise1/0/1900NNNLeon3/8/2024FFF
8FFFSue1/0/1900GGG
9GGGRon1/0/1900HHH5/1/2024
10HHHLeo5/1/2024KKK
11KKKFrank1/0/1900OOO
12OOORonaldo1/0/1900NNN3/8/2024
13NNNLeon3/8/2024BBB9/3/2024
14ZZZShondha AAA########
15LLLMona1/0/1900LLL
16
17
18
19
20
Details
Cell Formulas
RangeFormula
C3:C15C3=XLOOKUP(A3,$L:$L,$M:$M,"",,-1)
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try

Excel Formula:
=FILTER(A3:C15,(C3:C15>=TODAY())*(C3:C15<>""))
 
Upvote 0
Try

Excel Formula:
=FILTER(A3:C15,(C3:C15>=TODAY())*(C3:C15<>""))
Thank you for the quick respond! I like your suggested formula, however, I don't want to filter the results. What I want is exactly the same desired results table, where I get only current date, and future dates, and blanks for the rest of rows (if they meet the set criteria).
Can you suggest a different formula pls?
 
Upvote 0
In what way doesn't the formula from jec work for you?
It gives the same result as you showed.
 
Upvote 0
In what way doesn't the formula from jec work for you?
It gives the same result as you showed.
Hi @Fluff ! I don't need a filtered summary, what I need is to the desired results, where it brings the most recent date for duplicate IDs with more than one date, ignore the old dates and show blank for any date that is older than today, and show the dates that has the format 1/0/1900 as blank, these are the conditions that I want to incorporate to my current formula.

Xlookup Help with dates criteria.xlsx
ABCDEFGHIJKLMN
1Current ResultDesired ResultsIDsDates
2IDsNameDatesIDsNameDatesAAA
3AAAJohn10/3/2024AAAJohn10/3/2024BBB3/3/2024
4BBBWill9/3/2024BBBWill9/3/2024CCC9/7/2024
5CCCAbbey9/7/2024CCCAbbey9/7/2024DDD11/4/2021
6DDDDon11/4/2021DDDDonEEE
7EEELouise1/0/1900EEELouiseFFF
8FFFSue1/0/1900FFFSueGGG
9GGGRon1/0/1900GGGRonHHH5/1/2024
10HHHLeo5/1/2024HHHLeo5/1/2024KKK
11KKKFrank1/0/1900KKKFrankOOO
12OOORonaldo1/0/1900OOORonaldoNNN3/18/2024
13NNNLeon3/18/2024NNNLeon3/18/2024BBB9/3/2024
14ZZZShondha ZZZShondhaAAA10/3/2024
15LLLMona1/0/1900LLLMonaLLL
16
17
18
Details
Cell Formulas
RangeFormula
C3:C15C3=XLOOKUP(A3,$L:$L,$M:$M,"",,-1)
 
Upvote 0
That is completely different from what you originally showed as the expected result.
How do you expect to get something that works when you do that?
 
Upvote 0
That is completely different from what you originally showed as the expected result.
How do you expect to get something that works when you do that?
You're right, I accidentally copy the incorrect table, sorry for the confusion. I updated the desired table and edited the dates to match the criteria that I need.
 
Upvote 0
Ok, how about
Excel Formula:
=TAKE(FILTER($M$2:$M$15,($M$2:$M$15>=TODAY())*($L$2:$L$15=A3),""),1)
 
Upvote 0
Solution
Ok, how about
Excel Formula:
=TAKE(FILTER($M$2:$M$15,($M$2:$M$15>=TODAY())*($L$2:$L$15=A3),""),1)
If anyone asked me how do you know sophisticated formulas, I would say you're name! THANKS a MILLION! The formula is exactly what I needed.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,139
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top