"anyone know what is the formula for D17?
if i input B17 as Start and C17 as End
1200-2000 = will cost 800*300 = 240,000
2000-3000 = will cost 1000*400 = 400,000
3000-3500 = will cost 500*500 = 250,000
240k 400k 250k = 890k
CodePudding user response:
Use VLOOKUP in a SUMPRODUCT:
=SUMPRODUCT(VLOOKUP(SEQUENCE(B14-A14,,A14),A2:C11,3))
If one does not have SEQUENCE then use ROW with two INDEXES:
=SUMPRODUCT(VLOOKUP(ROW(INDEX($ZZ:$ZZ,A14):INDEX($ZZ:$ZZ,B14-1)),A2:C11,3))