XLOOKUP - how to extend the 'If not found' argument to the return array?

Chazzo

New Member
Joined
Dec 28, 2014
Messages
24
Office Version
  1. 365
Hello All,

Is there a way to have the 'If_not_found' argument extended so that it populates all cells to the return array?

For example, I would like to have the text string "Not Found" spill to range I:K in my example below.

By default, it appears that it will only fill the left most column.

My formula is written in H2 and is as follows: =XLOOKUP(G2,A:A,B:E,"Not Found")

Is it possible to have the formula return the 'if not found' input to all of the cells in the return array vs the left most column only?

Thank you in advance...

image001.png
 

Attachments

  • image001.png
    image001.png
    9.3 KB · Views: 3

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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’)

How about
Excel Formula:
=XLOOKUP(G2,A:A,B:E,{"Not Found","Not Found","Not Found"})
 
Upvote 0
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’)

How about
Excel Formula:
=XLOOKUP(G2,A:A,B:E,{"Not Found","Not Found","Not Found"})
Thanks Fluff,

I updated my account details to show that I'm using 365. Your solution certainly works and I have taken note. I thought there may be a way to have the argument spill over the same way the the matches would within the range. I appreciate the quick feedback!
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0
I thought there may be a way to have the argument spill over the same way the the matches would within the range.
You could try these, particularly if it needs to spill over a lot of columns.

Excel Formula:
=XLOOKUP(G2,A:A,B:E,INDEX("not found",SEQUENCE(,COLUMNS(B:E),,0)))
Excel Formula:
=XLOOKUP(G2,A:A,B:E,MAKEARRAY(1,COLUMNS(B:E),LAMBDA(r,c,"not found")))
 
Upvote 0
Solution
You could try these, particularly if it needs to spill over a lot of columns.

Excel Formula:
=XLOOKUP(G2,A:A,B:E,INDEX("not found",SEQUENCE(,COLUMNS(B:E),,0)))
Excel Formula:
=XLOOKUP(G2,A:A,B:E,MAKEARRAY(1,COLUMNS(B:E),LAMBDA(r,c,"not found")))
Thanks Peter!

This is closer to what I was looking for. The first formula works great, couldn’t get the second one to work but I have what I need.

Thanks again!
 
Upvote 0
This is closer to what I was looking for.
But not exactly?? :unsure:


couldn’t get the second one to work
If you got a #NAME? error then it probably means that you have updates to Office that have not been applied. If it was something else that went wrong I would be interested to know what it was as the two formulas produced identical results for me.

Thanks Peter!
You're welcome. :)
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,809
Members
449,048
Latest member
greyangel23

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