Sometimes SUM_IF can get the job done.
Suppose you have a sheet of product information, including unique productID
in column A and unit price in column P. And a sheet of purchase order entries with product IDs in column A, and you want column T to calculate the unit price for the entry.
The following formula will do the trick in cell Entries!T2 and can be copied to the other cells in the same column.
=SUMIF(Products!$A$2:$A$9999,Entries!$A2, Products!$P$2:$9999)
Then you could have another column with number of items per entry and multiply it with the unit price to get total cost for the entry.