Im trying to get this if statement to count up to 40 and post the results up to 40 in the designated cell, in this case its I18. The problem I am having is that when it adds up the cells from f, g, and h, it takes the whole number in the cell and removes it if the total is over 40. However what I need it to do is split up the number until that cell equals exactly 40, and then have the remainder go to a different cell with opposite formula.
=IF((AND(I18>0,SUM(F17:F21)+SUM(G17:G21)+SUM(H17:H21)+SUM(I17:I18)<40)),I18,0)
Thanks for your help.
=IF((AND(I18>0,SUM(F17:F21)+SUM(G17:G21)+SUM(H17:H21)+SUM(I17:I18)<40)),I18,0)
Thanks for your help.