I have developed nested IF formula that works fine but I have to use it in 44835 cells that makes my Excel file 4,8 Mb in size and worksheet pretty slow on i5 Intel with 8 Gb of ram. Is there any way to rewrite formula to make it more efficient or maybe do something else to speed up my program?

If it is MO, TU, WE, TH, FR and Working time is <= 8 -> perform calculation -> if Working time is > 8 perform another calculation

If it is SA and Working time is <= 8 -> perform calculation -> if Working time is > 8 perform another calculation

If it is SU and COUNTA($E11:$O11)=6 -> perform calculation -> if COUNTA($E11:$O11)=6 = FALSE perform another calculation

Code:

`=IF(P11="";"";IF(OR(P$9="MO";P$9="TU";P$9="WE";P$9="TH";P$9="FR");IF(P11<=8;P11*$K$37*($C11+$D11+$E11);8*($K$37)*$C11+IF(MAX(0;P11-8)-MAX(0;P11-10)<0;0;((MAX(0;P11-8))-(MAX(0;P11-10)))*$K$15*($C11+$D11+$E11)*(1+Data!$U$2))+IF((MAX(0;P11-8)-2)<=0;0;(MAX(0;P11-8)-2)*$K$37*($C11+$D11+$E11)*(1+Data!$V$2)));IF(P$9="SA";IF(P11<=8;P11*$K$37*($C11+$D11+$E11)*(1+Data!$T$3);8*$K$37*$C11*(1+Data!$T$3)+IF((P11-8)<0;0;(P11-8)*$K$37*$C11*(1+Data!$U$3)));IF(P$9="SU";IF(COUNTA($E11:$O11)=6;P11*($K$15*$C11*(1+Data!$W$3));P11*($K$37*$C11*(1+Data!$V$3)));""))))`

**Task:**If it is MO, TU, WE, TH, FR and Working time is <= 8 -> perform calculation -> if Working time is > 8 perform another calculation

If it is SA and Working time is <= 8 -> perform calculation -> if Working time is > 8 perform another calculation

If it is SU and COUNTA($E11:$O11)=6 -> perform calculation -> if COUNTA($E11:$O11)=6 = FALSE perform another calculation

Last edited: