Xlookup with dynamic criteria

indygo

Board Regular
Joined
Dec 2, 2013
Messages
126
Office Version
  1. 365
Platform
  1. Windows
hi,
I couldn't find this in forum history. Any help is appreciated.
The question is very simple, why this type of formula doesn't work? I want to focus on the lookup_value part only:
Both A2 and B2 are types of ID numbers, and -1 is there to simply look one value below. It's a multiple search criteria which doesn't seem to accept any dynamic calculation.

=XLOOKUP($A2&$B2-1,

the same with alternative version with cell reference

=XLOOKUP($A2&($B2-D$1)

thanks
Indygo
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

You cannot subtract 1 from a string, which is why it doesn't work.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

You cannot subtract 1 from a string, which is why it doesn't work.
apologies, updated
 
Upvote 0
Thanks for that (y)
It's not clear what you are trying to do, but as I said before you cannot subtract 1 from a string.
If you are trying to find a match & return the row below the match you will need to offset the return range by one row.
 
Upvote 0
=XLOOKUP($B2&$L2-1,$B$2:$B$200000&$L$2:$L$200000,$J$2:$J$200000,"")
This is my entire formula, any recommendations how to replace this part to make it work?
 
Upvote 0
Without knowing what you are trying to do, it's very difficult to help.
Can you please explain & also provide some sample data along with expected results?
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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