XFunctions icon indicating copy to clipboard operation
XFunctions copied to clipboard

xlookup add in doesn't work properly

Open VivienWW opened this issue 4 years ago • 5 comments

Hi I have add in ExcelDna.xfunction version 5. only very basic function is working like use it as vlookup, most the function doesn't work image for example if my lookup value is single cell, it's working. if my lookup value is multi cells, it doesn't work image Also if i want to use more complicated xlookup function like search the next smaller value, it doesn't work via single cell or multi cells image

I use microsoft 2019, I install for 64 image

please advise it

Thanks Vivien

VivienWW avatar Oct 15 '21 23:10 VivienWW

It might be that the XLOOKUP replacement function is returning the array, but if you don't select a target range of the right size and enter it as an array formula with Ctrl+Shift+Enter, the result will only show the first result item.

The Dynamic Arrays feature of new Excel is what make the XLOOKUP result automatically expand, and this feature is much harder to patch into an old Excel version. The XFunctions add-in is not trying to do Dynamic Arrays, it just does the two XMATCH and XLOOKUP functions.

govert avatar Oct 16 '21 11:10 govert

Also if i want to use more complicated xlookup function like search the next smaller value, it doesn't work via single cell or multi cells

For this case, I manually selected the right area. Didn’t use ctrl + shift + entry. But always return as #value?. What did I do wrong? Thanks Vivien

VivienWW avatar Oct 16 '21 11:10 VivienWW

A single cell function looking for next smaller value should work fine, the same as the real XLOOKUP. Can you make up a small example where you have a problem, so I can test it?

govert avatar Oct 17 '21 10:10 govert

Thank you Govert so much for your help.

This is the simple case. If I use Microsoft 365, it is working perfectly. If I use 2019 excel, it doesn't work at all

xlookup case.xlsx

Please advise it

Thanks Vivien

VivienWW avatar Oct 17 '21 11:10 VivienWW

OK I've had a first look. I see there are two bugs in my implementation, one is easy to fix, the other will need a bit more effort. The easy one is to do with the "-2" descending option, where I had a typo. The second has to do with the handling of empty cells. I still have to figure out what Excel is doing in this case - it is not consistent between MATCH and XMATCH. But at the moment the XFunctions replacement for XLOOKUP sometimes doesn't handle empty cells in the looked up array.

Thanks for showing me the problems. I'll post back here when I've pushed a fix.

govert avatar Oct 18 '21 05:10 govert