Your SUMPRODUCT formula is correct.
Change formula in Col G to
=IF(D2=0,0,D2-C2) and copy down
Similarly, change formula in Col H to
=IF(E2=0,0,E2-D2)
This is because you want to continue charging the same rate as the previous rate beyond the slab too, hence incremental rate is zero.
See attached.
Does this help?
Bookmarks