For convenience, the range E5:F9 isnamedcost_table.
VLOOKUP function
VLOOKUP is an Excel function to get data from a table organizedvertically.
VLOOKUP requires lookup values to be in thefirstcolumn of the lookup table.
If it finds an exact match, it will return the cost in that row.
This means the cost table must be sorted in ascending order by weight.
Whenrange_lookupis omitted, it defaults to TRUE and VLOOKUP performs an approximate match.
In other words, giving a value forrange_lookupacts as a reminder to you and others of the intended behavior.
In the example shown, we use zero in cell E5 to check that this does not occur.
MAX ignores empty cells, the logical values TRUE and FALSE, and text values.