I am setting up a vlookup to pull product prices from another sheet within the workbook. The code works for the cell but when i try to expand or copy and past the code into the next row it automatically changes the data table_array value.
=VLOOKUP(B5,Prices!1:65536,3)
Within the code i want the first value, B5 to scale with the row it is in, however the second value needs to remain the same. How do i go about doing this? Also is there a way that i can get the cell to remain blank instead of displaying N/A if there isnt a valid part number?
Thanks for your help!
For the second part, an IF formula will work fine:
And if I understand correctly the first part have you tried set an absolute value? Something like:
I can't comment because I do not have enough rep but this will fix
user3716271
's formula:The following formula should solve both problems as well, a little more compact and would use one less
VLOOKUP()
:As
guitarthrower
had said, the$
before the number is used to lock the range.The
$
lock the range.For example.
$A1
will lock the column toA
when the formulas is copied other locations.A$1
will lock the row$A$1
will lock both the column and the row.