(Now...sodium hydroxide (which is used to make solid/bar soaps) and potassium hydroxide (which is used to make liquid soaps) each have different SAP numbers for oils. For the purposes of the example below, I'm going to use the sodium hydroxide numbers.)
For example, to make bar soap with sodium hydroxide, the SAP number for olive oil is .135.
To calculate the amount of lye needed, you multiply the amount of oil by the SAP number.
So, to completely saponify 10 ounces of olive oil:
10 (ounces) X .135 = 1.35 (ounces) of lye
If you're doing pounds or kilograms, just substitute that measure on both sides.
To calculate a more complex recipe, you do the same calculation for each oil in the recipe...and add up the total amount of lye needed.
For example, to put a 5% lye discount onto the 10 ounces of olive oil we're saponifying above, you'd multiply the 1.35 ounces of lye by 5% to find the amount to subtract. (You could also multiply it by 95% to find out the amount to keep.)
1.35 ounces of lye X 5% = .0675 ounces
Discounted amount of lye = 1.35 - .0675 = 1.28 ounces (rounded down)
Hopefully this will help you understand the math behind calculating the lye for a recipe...and also make you appreciate the programming and calculations behind the many different lye calculators that we have to use as soap makers.