Thanks vletm
Column E- Duration is not simply the difference between columns C and D. It depends on work pattern shift. I can't use networkday function as some employee work on 4 On and 4 Off shifts. Column E figures are produced by software. If you look at my formula in column L, if RTW is "Unpaid" regardless of the cumulative figure, the person only gets SSP, but only if SSP is>3.
What I am trying to achieve is:
If RTW is "Unpaid" and duration is >3, calculate SSP.
If duration plus Cum (Columns E and H) is <=10, I do not need to work out SSP as the employee is covered by 10 days allowance.
If plus Cum (Column H) is >10 (Without adding duration), it is simply =duartion minus 3 times the rate.
Where I got stuck and gets tricky is when duration plus cum >10. Upto 10 is covered by allowance, then I need to work out SSP. my formula falls on at least two rows. For eg, row 41: duration is 10 and cum is 0.5. Only 0.5 SSP. Why? 0.5+9.5=10. Because I used 9.5 out of 10 duration to 10 days allowance, then left with 0.5 for SSP, but my logic falls.