Trying to run a Hlookup on a table that is linked to a query in a MS database. The data table is in a separate tab and starts in row 3, and includes a header row. So headers are in row 3, data is from row 4 onwards. data table is named My_Table My HLOOKUP formula is;
=HLOOKUP("Product1",My_Table,A3,false)
Product1 is the actual header of the column to find, and the cell A3 contains the row number for the lookup. However, this didn't return the data expected. Stepping through the evaluate formula function, Excel is calculating the table to begin in row 4, so is looking for the header in the wrong row (ie row 4). Checking the name manager, the table is locked and shows as starting in row 3.
Has anyone encountered/found a way around this? I would like to keep the table as a table so that it dynamically extends rows as needed based on the results of the query.
To reference the whole table, use
=HLOOKUP("Product1",My_Table[#All],A3,FALSE)
This is called Structured Referencing
Other examples
=TableName[#All]
=TableName[#Headers]
=TableName[[#All], [ColumnName]]
=TableName[[#Headers], [ColumnName]]
=TableName[[#This Row][ColumnName]]
=TableName[@ColumnName]
=TableName[#Headers]
=TableName[#All]
=TableName[#Totals]