Removing the last blank line from an Xlookup.

DazCD

New Member
Joined
Aug 19, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Good morning all,

As the title says, I have a a blank line that sometimes returns at the last row due to the difference of the amount of items a gift pack may contain. (I've tried to upload the mini book but can't seem to get it to work so I'll have to post images)

If the Gift pack contains 5 components, naturally the 5th row will reference data. However, if the gift pack has 4 components, you can see from the image that the low row is "0" & "#N/A", respectively. I've tried using the FILTER function but FILTER still evades me as to how it actually works.

=IF($A$2="","",XLOOKUP(A3,'F:\Quality Control\Ingredient Listings\[CD Ingredient List (EFACS).xlsx]Finished'!$A:$A,'F:\Quality Control\Ingredient Listings\[CD Ingredient List (EFACS).xlsx]Finished'!$B:$B))

The above formula is what i'm using to pull those components codes.

Additionally, is there any way to shorten or make the formulas easier to read rather than having it spammed with "F:\Quality Control\Ingredient Listings\[CD Ingredient List (EFACS).xlsx]Finished'!$A:$A" ?

Thank you for any replies, have a nice day!
 

Attachments

  • Image 1 - last row blank.png
    Image 1 - last row blank.png
    13.1 KB · Views: 7
  • Image 2 - Top level codes with components.png
    Image 2 - Top level codes with components.png
    21.3 KB · Views: 7

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Presumably it's the XLOOKUP that's returning the #N/A? XLOOKUP has an optional if_not_found argument that you could set to "" if you wish.

It's not clear from the question what's causing the 0 value, or whether you want to suppress it?

And it's also not clear why you think FILTER might be appropriate?
 
Upvote 0
Solution
Apologies, I overlooked the [If not found], in the XLOOKUP.

Fixed it. thank you.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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