Pasting data into lookup range returns empty cells

Copper Contributor

I am attempting to retrieve data from a webpage that does not provide an export feature and use that data in a spreadsheet. The webpage containing the data displays open purchase orders with status update information in a table-like configuration such that I can copy and paste it into a sheet which I label "raw".

 

Then in a separate sheet labeled "Status"  I list all open customer invoices in column 1 and the purchase order numbers attached to them in column 2. I then use xlookup to retrieve the status information for the purchase order from the raw table into columns 3 and 4. This works flawlessly the first time. But when I paste updated data into the raw table, suddenly all my xlookups return empty cells. I have tried using paste special, paste values, basic paste, and match destination formatting paste all to no avail. I tried re-entering the formula but it did nothing. I used calculate sheet and calculate now... Still nothing. I checked to make sure that relative references hasn't messed with me but they still pointed to the correct range. The only way I found to solve it was to delete the columns with the xlookups and re-build them from scratch and then they worked fine. But this is highly impractical as I am working with several thousand lines of data that I need to see updated information on daily and I need to be able to sort it.

 

I also have another table where I import merchandise data into raw tables from several external sources on separate sheets for different categories and then compile them into a larger, more complete sheet using xlookup inside nested ifs to import the data from the correct sheet based on the item's category. Again, it works super until I go to import updated data, at which point, I find myself having to rebuild the spreadsheet again. Again, this information is such that I need to update it regularly, and without a reliable data connection that I can maintain with the website (third party) I'm not sure how else to import my data without referencing the table I'm provided. 

 

Can someone help me sort out what I'm doing wrong? Why does the xlookup stop working when I update the information in the lookup range? 

2 Replies

Hi @Sinistersam 

 

is it possible that you provide a sample file (all sensitive data removed) which shows the situation after you have pasted new data in your raw data sheet?

This way, we could have a closer look on the formulas and references and possibly provide some advices.

When pasting data into a lookup range and encountering empty cells, it's crucial to understand how lookup functions work and why this might happen. Here are some reasons and solutions for encountering empty cells when pasting data into a lookup range:

1. Formatting Issues

  • Reason: Different formatting between the source data and the lookup range can lead to empty cells or mismatches.
  • Solution: Ensure that the formatting (e.g., text, numbers, dates) in both the source data and the lookup range is consistent. You may need to format the cells to match the data type before pasting.

2. Non-Matching Data

  • Reason: If the lookup values in the source data don't match the values in the lookup range, Excel will return empty cells.
  • Solution: Double-check the data to ensure that the lookup values in the source data exist in the lookup range. You may need to clean or modify the data to align the lookup values properly.

3. Partial Match

  • Reason: Some lookup functions like VLOOKUP and HLOOKUP require an exact match by default. If no exact match is found, an empty cell may be returned.
  • Solution: If you are using VLOOKUP or HLOOKUP, consider using functions like INDEX-MATCH or XLOOKUP that allow for more flexible matching criteria, including approximate matches.

4. Array Formulas

  • Reason: If you are using an array formula for lookup, any error or inconsistency in the array can result in empty cells.
  • Solution: Review the array formula to ensure it's structured correctly and that all referenced cells contain the expected data.

5. Data Range

  • Reason: The range where you are pasting the lookup values might not include all necessary cells, leading to empty results.
  • Solution: Expand the range where you are pasting the data to ensure it covers all the lookup values and the corresponding return values.

6. Hidden or Filtered Rows

  • Reason: Hidden or filtered rows in the lookup range can affect the results of the lookup function.
  • Solution: Make sure there are no hidden or filtered rows that might be interfering with the lookup. Unhide or clear any filters as needed.

By addressing these potential issues, you should be able to resolve the problem of encountering empty cells when pasting data into a lookup range.