Removing the last blank line from an Xlookup.

DazCD

New Member
Joined
Aug 19, 2024
Messages
7
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: 6
  • Image 2 - Top level codes with components.png
    Image 2 - Top level codes with components.png
    21.3 KB · Views: 7

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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