xlookup v index

henryg

Board Regular
Joined
Oct 23, 2008
Messages
143
Office Version
  1. 365
Platform
  1. Windows
Typically I want to extract the latest balance (the last figure) from a table of summed data which is sorted in ascending date order. Up to now, I have used the Index function, as in

INDEX(Table16[Column5],COUNTA(Table16[Column5])

but I always find Index unintuitive, so thought of the new Xlookup and easily and quickly came up with the formula

XLOOKUP(TODAY(),Table16[Column1]],Table16[Column5]],-1,-1))

The Index formula is more concise, and I wonder about calculation times. I find the Xlookup formula more intuitive to construct, but am I silly to use it in place of the more concise Index?
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Without seeing the underlying vba code used to run your XLOOKUP udf we are not in a position to judge performance, however I would suspect that the native index function will offer superior performance.

If your task is as simple as your post, you could just use =LOOKUP(1e+100,Table16[Column5])
 
Upvote 0
@jasonb75
I suspect the OP is referring to the beta Excel worksheet function XLOOKUP, only available to selected users, not a UDF.
 
Upvote 0
Thanks, Peter!

I happen to be one of the mere mortals not privy to such things. Looks like it has the potential to be quite a useful function, think it might be a bit more than is needed for the OP's purpose here though.
 
Upvote 0
Yes, indeed, I have the Insider version, and XLOOKUP is a bit of a new toy! Mike Girvin at ExcelisFun has a comprehensive video at

https://www.youtube.com/watch?v=WO6Kjba5EPc

But it is really good, and resolves a lot of problems with VLOOKUP, and obviates the need for INDEX/MATCH to solve them in many/most situations. For some reason I have always had a issues using INDEX/MATCH, whereas I find XLOOKUP easy and intuitive. I'm hoping it is not a lot slower, but have no means to test that.
 
Upvote 0
I happen to be one of the mere mortals not privy to such things.
I am in the same boat as you in terms of (not) having the function - I just happen to have read a little about it. :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,255
Members
448,556
Latest member
peterhess2002

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