Vlookup problem on external data table

Hi there!

So I’m having a little problem with a vlookup function that I could use some help with.

Setup: I have a table on one sheet that’s imported from SQL using a macro. The macro selects all values in the database on the date specified on the spreadsheet by the user. On each date, there can be a different number of observations (so sometimes I have 100 rows in my table, sometimes 200).

On another sheet, I have a vlookup which references this table. The vlookup uses table column references ( e.g. Table1[date]) which I thought would be fine for tables with varying number of rows.

So the problem is: when I refresh the data (extract all the values on a different date), and I have less rows than before, everything works fine! When I refresh the data but I have MORE rows all my vlookup a return #NA. In fact,

As I’m using column references for the table I figured there wouldn’t be a problem. However, I’m struggling to tell whether this is a problem with the External data or with my use of vlookups. Any help would be appreciated.

Thanks in advance!
A

By: Andrew

Leave a Reply

Your email address will not be published. Required fields are marked *