XLOOKUP and FILTER: Help Sorting the Results

atypicalguy

New Member
Joined
Jun 11, 2024
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hey you fabulous excel champs,

Received fantastic help on my last post so I'm back with two more questions I'm hoping this brilliant community could help me with:

Formula 1.)
Excel Formula:
=XLOOKUP([@[Equip. SN]],Table1[[#All],[Equip. SN]],Table1[[#All],[Latest Due Date]],,,-1)

I'm using this formula to find the most-recent date an xray machine was last tested, linking/searching/referencing by the equipment serial number. The "-1" works fine, sorting it by the most recent entry it pulls from the raw data/source, but not if I'm putting in older data - it seems like the "-1" interprets this as the most recent, instead of actually using the date.

Is there a MAX( or other function that would work in sorting it by the biggest date it can link with that serial number?

Formula 2.)
Excel Formula:
=FILTER(Table1[#All],((Table1[[#All],[Next QAT Due On]]<L21+40)))

I'm using this formula to highlight the xray machines that are past due/coming up due for quality assurance testing.

Is there a way to group these clinics by name regardless of date - while still keeping the parameter of +40 days past the present day (L21)?

Thanks again!
 

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
How about
Excel Formula:
 =take(sort(filter(hstack(Table1[Equip. SN],Tabke1[Latest Due Date]),Table1[Equip. SN]=[@[Equip. SN]]),2,-1))
and
Excel Formula:
=sort(FILTER(Table1[#All],((Table1[[#All],[Next QAT Due On]]<L21+40))))
 
Upvote 0
Fluff! Good to see your name pop up in the thread again!

Formula 1.) It's not taking it, giving the generic message saying there's a problem with the formula. :(

Formula 2.) Works like a charm! Are we able to sort it once more by most oldest date first, and then grouped by clinic or is that too many qualifiers?
 
Upvote 0
**correction** on Formula 1.) There was a typo that I corrected, now it's saying "You've entered too few arguments for this function"
 
Upvote 0
Missed the last bit,
Excel Formula:
 =take(sort(filter(hstack(Table1[Equip. SN],Tabke1[Latest Due Date]),Table1[Equip. SN]=[@[Equip. SN]]),2,-1),1,1)
Are we able to sort it once more by most oldest date first
What column is the date in?
 
Upvote 0
For the first formula:
Excel Formula:
=take(sort(filter(hstack(Table1[Equip. SN],Table1[Latest Due Date]),Table1[Equip. SN]=[@[Equip. SN]]),2,-1),1,1)
... it works, but is spitting out the serial numbers instead of the latest date!

For the second formula:
The date column starts in L12 with the header, but will be using the finalized formula above to determine the date they're actually due, based on the "most recent/latest" date
 
Upvote 0
In that case change the 1,1 to 1,2
and
Excel Formula:
=sort(FILTER(Table1[#All],((Table1[[#All],[Next QAT Due On]]<L21+40))){1,12})
 
Upvote 0
Excel Formula:
=take(sort(filter(hstack(Table1[Equip. SN],Table1[Latest Due Date]),Table1[Equip. SN]=[@[Equip. SN]]),2,-1),1,2)

... is coming back with a #SPILL error, is there a quick formatting fix I can make or is there something else I can try to resolve that error?

Excel Formula:
=sort(FILTER(Table1[#All],((Table1[[#All],[Next QAT Due On]]<L21+40))){1,12})

... is coming back with "There was a problem with the formula" :(
 
Upvote 0
The 1st one should be 1,-1 not 1,2

for the 2nd one, can you post some data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Solution
That first one is signed, sealed and delivered! Thanks for that!

For the second one, I'm not able to download much of anything on my work computer, so I'll probably have to settle with what I've got from your last suggestion in this thread - but the "settle" is loads better than it was so thanks all the same!
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
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