XLOOKUP - Lookup Value is a formula

p33lcg

New Member
Joined
Apr 10, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am having some problems using XLOOKUP as my lookup value is generated by a formula, I am therefore getting the dreaded #NA. The formula works and the value is definitely in the array as if I manually type the value, it can find it.

I am trying to use the value in F3 which has the below formula in:

=IF(ISBLANK(B3),"",MID(B3,FIND("Member:",B3)+7,FIND("Automated",B3)-FIND("Member:",B3)-7))

The XLOOKUP Formula is:

=IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(XLOOKUP(F3, Sheet1!C:C, Sheet1!A:A), XLOOKUP(F3, Sheet1!D:D, Sheet1!A:A)), XLOOKUP(F3, Sheet1!E:E, Sheet1!A:A)), XLOOKUP(F3, Sheet1!F:F, Sheet1!A:A)), XLOOKUP(F3, Sheet1!G:G, Sheet1!A:A)), XLOOKUP(F3, Sheet1!H:H, Sheet1!A:A)), XLOOKUP(F3, Sheet1!I:I, Sheet1!A:A)), XLOOKUP(F3, Sheet1!J:J, Sheet1!A:A)), XLOOKUP(F3, Sheet1!K:K, Sheet1!A:A))

As a note, F3 produces a code such as "R4G6" and the lookup produces a name.

Any help would be much appreciated.

P.s any tips on getting the long formulas shortened would also be welcomed if possible!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Review the formula information for XLookup.

try
XLookup.xlsm
FG
1
2
3R4G6ABCD
4
6e
Cell Formulas
RangeFormula
G3G3=XLOOKUP(F3, Sheet1!C:C, Sheet1!A:A,"",0)


You could make a small example and then try Formulas Formula Evaluate

N.B. You can post a concise example of your sheet with the forum's tool named XL2BB.

You may not need full column references; consider a reasonable number considering your data.
 
Last edited:
Upvote 0
1. We do not know your data.
2. We do not know what you are trying to do.

3. There are variety of different approaches explained on the internet.

5. One idea is to consolidate your data ranges with Vstack and then use XLookup or another formula
My example uses multiple sheets but the idea works with multiple ranges or tables.

XLookup.xlsm
FGHIJKLM
3R4G6ABCD000
6e
Cell Formulas
RangeFormula
H3H3=XLOOKUP(F3, M3:M44,K3:K44,"",0)
K3:M44K3=VSTACK(Sheet1!A2:C20,Sheet2!A2:C24)
Dynamic array formulas.
 
Last edited:
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=TAKE(TOCOL(IF(Sheet1!C$2:K$1000=F3,Sheet1!A$2:A$1000,1/0),2),1)
 
Upvote 0
Solution
Hello Both,

Thanks for your responses, unfortunately neither have worked.

I can't use XL2BB as states doesn't work on protected workbooks (work PC), I have though put the examples in a screenshot to give some clarity, the formulas for each are underneath.

On the actual sheet I'm using, there is around 100 rows, but won't have duplicates

Thank you again.
 

Attachments

  • T2 XLOOKUP.png
    T2 XLOOKUP.png
    32.1 KB · Views: 13
  • T1 XLOOKUP.png
    T1 XLOOKUP.png
    82.3 KB · Views: 13
Upvote 0
With the TOCOL/IF approach you should have the ranges the same number of rows.
That said it would not give an error unless the value in E3 was not found. Check that it does not have any leading/trailing spaces or other hidden characters.
 
Upvote 0
Hi Fluff,

You're a star thank you! Have sorted it, you're right is because there was a hidden space in E3 value, I have adjusted the E3 formula and works sweet now.

Thank you :)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,123
Messages
6,123,183
Members
449,090
Latest member
bes000

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