Complicated MOD function that possibly might just be algebra..

Something like this? If so, formulas are:

If we want to use INT (which effectively rounds remedial down):

In C6:
=INT((B4-(B4*B3))/B2)

In C7:
=INT((INT((((B4-(B4*B3))/B2)*B2))*B3))

In C8:
=(INT(((B4-(B4*B3))/B2))*B2)+INT((INT((((B4-(B4*B3))/B2))*B2)*B3))

In C9:
=B4-((INT(((B4-(B4*B3))/B2))*B2)+INT((INT((((B4-(B4*B3))/B2))*B2)*B3)))

If we want to use ROUNDUP (to round remedial up to the next whole number):

In D6:
=INT((B4-(B4*B3))/B2)

In D7:
=ROUNDUP((INT((((B4-(B4*B3))/B2)*B2))*B3),0)

In D8:
=(INT(((B4-(B4*B3))/B2))*B2)+ROUNDUP((INT((((B4-(B4*B3))/B2)*B2))*B3),0)

In D9:
=B4-((INT(((B4-(B4*B3))/B2))*B2)+ROUNDUP((INT((((B4-(B4*B3))/B2)*B2))*B3),0))

Instead of repeating the calculations (from C7 or D7 down), you could reference the already-calculated cells.

/r/excel Thread