'How to resolve #N/A error with vlookup involving a database query return in Excel

I'm getting a strange #N/A error excel/vlookup. I have a database connection with sql query returning a lot of rows ~40k. I have a field with two data values separated with a comma. I am breaking these up with a right(cell, 9) to obtain the lookup value.

Then, am crafting the vlookup formula to lookup that value on a worksheet with that value and another cooresponding value. However, this results in an #N/A error. The cells where I am putting the formula is part of the sql result return and this forces the formula to be pushed onto every row in the table. In otherwords, =vlookup([@[I/E FINAL]],worksheetrangeA:C,3,false)/

I know if I hard code the lookup value into the vlookup it does return a legit result. Unsure how to work around this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source