Forum Discussion
Data?
Let's say you have a sheet PriceList with part numbers in A2:A50 and the corresponding prices in B2:B50.
On another sheet, you enter a part number in D2 and down (or select it from a drop-down list).
Enter the following formula in E2, then fill down.
If you have Microsoft 365 or Office 2021:
=XLOOKUP(D2, PriceList!$A$2:$A$50, PriceList!$B$2:$B$50, "")
If you have an older version:
=IFERROR(VLOOKUP(D2, PriceList!$A$2:$B$50, 2, FALSE), "")
- HansVogelaarAug 20, 2023MVP
The $ signs make the reference to the ranges on the PriceList sheet absolute, i.e. they won't change when you fill or copy the cell with the formula downwards.
See Switch between relative, absolute, and mixed references
The "" at the end makes the formula return a blank (empty string) if you enter a non-existent part code.