The answer is simple, it turns out: VLOOKUP.
VLOOKUP lets you enter a search term in a box. It will:
(1) find the search term in your data sheet
(2) search across the row where it finds the search term to whatever column you indicate
(3) return the value contained in that column.
Lets say you have a data sheet named ‘Data’ and on that sheet are four columns, D E F G labeled as follows:
D E F G
ITEM QUANTITY GROSS NET
and you are doing calculations on a second sheet (or document) named ‘Work’ and you would like to be able to enter search terms in column A of ‘Work’ and have column B of ‘Work’ magically fill with the ‘NET’ values found in column G of ‘Data’.
Proceed as follows:
(1) column A of 'Work' is left blank. This is where you will enter search terms
(2) column B of 'Work' gets the VLOOKUP formula in the following format:
=VLOOKUP(<imput cell>;<data range>;<column where answer is>;<exact match T/F>)
There are four pieces of information that have to be specified. The first is:
<imput cell> is the cell in 'Work' where you put your search term -- 'A1' 'A2' etc.
second:
<data range> is the range of cells in 'Data' containing the terms to search for AND the
data to return. For example, if the first item in Data, columnD is at row3,
and the last item in columnG is in row80, the range would be Data.D3:G80
If this information is in an entirely different document, you can open that
document and select the range just like you would do if the information
were in your working document.
third:
<answer> is how many columns over the program should look from where it finds the search term. If you know it is going to find the term in column D and that the answer you want back is in column G, enter '4'.
fourth:
<exact> this is important. The algorithm used by VLOOKUP is lazy. It only looks for an exact match to your search term if you tell it to. On my version of LibreOffice, Yes=0 and No=1. You want '0'.
Now, if you enter a search term at A1, say ‘bubblegum’, B1 will fill with the net cost of that item – say, ‘0.50’.
And that’s all there is to it.