=IF(AND(H40<=4,H40>=1),H40-H42,
IF(AND(H40<=8,H40>=5,H41<=4),4-H41,
IF(AND(H40<=8,H40>=5,H41>=5,H41<9),H40-H41,
IF(AND(H40<=12,H40>=9,H41<=4),4-H41,
IF(AND(H40<=12,H40>=9,H41>=5,H41<9),8-H41,
IF(AND(H40<=12,H40>=9,H41>=9,H41<13),H40-H41,
IF(AND(H40<=16,H40>=13,H41<=4),4-H41,
IF(AND(H40<=16,H40>=13,H41>=5,H41<9),8-H41,
IF(AND(H40<=16,H40>=13,H41>=9,H41<13),12-H41,
IF(AND(H40<=16,H40>=13,H41>=13,H41<17),H40-H41,
IF(AND(H40<=20,H40>=17,H41<=4),4-H41,
IF(AND(H40<=20,H40>=17,H41>=5,H41<9),8-H41,
IF(AND(H40<=20,H40>=17,H41>=9,H41<13),12-H41,
IF(AND(H40<=20,H40>=17,H41>=13,H41<17),16-H41,
IF(AND(H40<=20,H40>=17,H41>=17,H41<21),H40-H41,
IF(AND(H40<=24,H40>=21,H41<=4),4-H41,
IF(AND(H40<=24,H40>=21,H41>=5,H41<9),8-H41,
IF(AND(H40<=24,H40>=21,H41>=9,H41<13),12-H41,
IF(AND(H40<=24,H40>=21,H41>=13,H41<17),16-H41,
IF(AND(H40<=24,H40>=21,H41>=17,H41<21),20-H41,
IF(AND(H40<=24,H40>=21,H41>=21,H41<25),H40-H41,
IF(AND(H40<=28,H40>=25,H41<=4),4-H41,
IF(AND(H40<=28,H40>=25,H41>=5,H41<9),8-H41,
IF(AND(H40<=28,H40>=25,H41>=9,H41<13),12-H41,
IF(AND(H40<=28,H40>=25,H41>=13,H41<17),16-H41,
IF(AND(H40<=28,H40>=25,H41>=17,H41<21),20-H41,
IF(AND(H40<=28,H40>=25,H41>=21,H41<25),24-H41,
IF(AND(H40<=28,H40>=25,H41>=25,H41<29),H40-H41,
IF(AND(H40<=32,H40>=29,H41<=4),4-H41,
IF(AND(H40<=32,H40>=29,H41>=5,H41<9),8-H41,
IF(AND(H40<=32,H40>=29,H41>=9,H41<13),12-H41,
IF(AND(H40<=32,H40>=29,H41>=13,H41<17),16-H41,
IF(AND(H40<=32,H40>=29,H41>=17,H41<21),20-H41,
IF(AND(H40<=32,H40>=29,H41>=21,H41<25),24-H41,
IF(AND(H40<=32,H40>=29,H41>=25,H41<29),28-H41,
IF(AND(H40<=32,H40>=29,H41>=29,H41<33),H40-H41,
IF(AND(H40<=36,H40>=33,H41<=4),4-H41,
IF(AND(H40<=36,H40>=33,H41>=5,H41<9),8-H41,
IF(AND(H40<=36,H40>=33,H41>=9,H41<13),12-H41,
IF(AND(H40<=36,H40>=33,H41>=13,H41<17),16-H41,
IF(AND(H40<=36,H40>=33,H41>=17,H41<21),20-H41,
IF(AND(H40<=36,H40>=33,H41>=21,H41<25),24-H41,
IF(AND(H40<=36,H40>=33,H41>=25,H41<29),28-H41,
IF(AND(H40<=36,H40>=33,H41>=29,H41<33),32-H41,
IF(AND(H40<=36,H40>=33,H41>=33,H41<37),H40-H41,
IF(AND(H40<=40,H40>=37,H41<=4),4-H41,
IF(AND(H40<=40,H40>=37,H41>=5,H41<9),8-H41,
IF(AND(H40<=40,H40>=37,H41>=9,H41<13),12-H41,
IF(AND(H40<=40,H40>=37,H41>=13,H41<17),16-H41,
IF(AND(H40<=40,H40>=37,H41>=17,H41<21),20-H41,
IF(AND(H40<=40,H40>=37,H41>=21,H41<25),24-H41,
IF(AND(H40<=40,H40>=37,H41>=25,H41<29),28-H41,
IF(AND(H40<=40,H40>=37,H41>=29,H41<33),32-H41,
IF(AND(H40<=40,H40>=37,H41>=33,H41<37),36-H41,
IF(AND(H40<=40,H40>=37,H41>=37,H41<41),H40-H41,
IF(AND(H40<=44,H40>=41,H41<=4),4-H41,
IF(AND(H40<=44,H40>=41,H41>=5,H41<9),8-H41,
IF(AND(H40<=44,H40>=41,H41>=9,H41<13),12-H41,
IF(AND(H40<=44,H40>=41,H41>=13,H41<17),16-H41,
IF(AND(H40<=44,H40>=41,H41>=17,H41<21),20-H41,
IF(AND(H40<=44,H40>=41,H41>=21,H41<25),24-H41,
IF(AND(H40<=44,H40>=41,H41>=25,H41<29),28-H41,
IF(AND(H40<=44,H40>=41,H41>=29,H41<33),32-H41,
IF(AND(H40<=44,H40>=41,H41>=33,H41<37),36-H41,
IF(AND(H40<=44,H40>=41,H41>=37,H41<41),40-H41,
IF(AND(H40<=44,H40>=41,H41>=41,H41<45),H40-H41,
IF(AND(H40<=48,H40>=45,H41<=4),4-H41,
IF(AND(H40<=48,H40>=45,H41>=5,H41<9),8-H41,
IF(AND(H40<=48,H40>=45,H41>=9,H41<13),12-H41,
IF(AND(H40<=48,H40>=45,H41>=13,H41<17),16-H41,
IF(AND(H40<=48,H40>=45,H41>=17,H41<21),20-H41,
IF(AND(H40<=48,H40>=45,H41>=21,H41<25),24-H41,
IF(AND(H40<=48,H40>=45,H41>=25,H41<29),28-H41,
IF(AND(H40<=48,H40>=45,H41>=29,H41<33),32-H41,
IF(AND(H40<=48,H40>=45,H41>=33,H41<37),36-H41,
IF(AND(H40<=48,H40>=45,H41>=37,H41<41),40-H41,
IF(AND(H40<=48,H40>=45,H41>=41,H41<45),44-H41,
IF(AND(H40<=48,H40>=45,H41>=45,H41<49),H40-H41,
IF(AND(H40<=52,H40>=49,H41<=4),4-H41,
IF(AND(H40<=52,H40>=49,H41>=5,H41<9),8-H41,
IF(AND(H40<=52,H40>=49,H41>=9,H41<13),12-H41,
IF(AND(H40<=52,H40>=49,H41>=13,H41<17),16-H41,
IF(AND(H40<=52,H40>=49,H41>=17,H41<21),20-H41,
IF(AND(H40<=52,H40>=49,H41>=21,H41<25),24-H41,
IF(AND(H40<=52,H40>=49,H41>=25,H41<29),28-H41,
IF(AND(H40<=52,H40>=49,H41>=29,H41<33),32-H41,
IF(AND(H40<=52,H40>=49,H41>=33,H41<37),36-H41,
IF(AND(H40<=52,H40>=49,H41>=37,H41<41),40-H41,
IF(AND(H40<=52,H40>=49,H41>=41,H41<45),44-H41,
IF(AND(H40<=52,H40>=49,H41>=45,H41<49),48-H41,
IF(AND(H40<=52,H40>=49,H41>=49,H41<53),H40-H41,
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
IF(AND(H40<=8,H40>=5,H41<=4),4-H41,
IF(AND(H40<=8,H40>=5,H41>=5,H41<9),H40-H41,
IF(AND(H40<=12,H40>=9,H41<=4),4-H41,
IF(AND(H40<=12,H40>=9,H41>=5,H41<9),8-H41,
IF(AND(H40<=12,H40>=9,H41>=9,H41<13),H40-H41,
IF(AND(H40<=16,H40>=13,H41<=4),4-H41,
IF(AND(H40<=16,H40>=13,H41>=5,H41<9),8-H41,
IF(AND(H40<=16,H40>=13,H41>=9,H41<13),12-H41,
IF(AND(H40<=16,H40>=13,H41>=13,H41<17),H40-H41,
IF(AND(H40<=20,H40>=17,H41<=4),4-H41,
IF(AND(H40<=20,H40>=17,H41>=5,H41<9),8-H41,
IF(AND(H40<=20,H40>=17,H41>=9,H41<13),12-H41,
IF(AND(H40<=20,H40>=17,H41>=13,H41<17),16-H41,
IF(AND(H40<=20,H40>=17,H41>=17,H41<21),H40-H41,
IF(AND(H40<=24,H40>=21,H41<=4),4-H41,
IF(AND(H40<=24,H40>=21,H41>=5,H41<9),8-H41,
IF(AND(H40<=24,H40>=21,H41>=9,H41<13),12-H41,
IF(AND(H40<=24,H40>=21,H41>=13,H41<17),16-H41,
IF(AND(H40<=24,H40>=21,H41>=17,H41<21),20-H41,
IF(AND(H40<=24,H40>=21,H41>=21,H41<25),H40-H41,
IF(AND(H40<=28,H40>=25,H41<=4),4-H41,
IF(AND(H40<=28,H40>=25,H41>=5,H41<9),8-H41,
IF(AND(H40<=28,H40>=25,H41>=9,H41<13),12-H41,
IF(AND(H40<=28,H40>=25,H41>=13,H41<17),16-H41,
IF(AND(H40<=28,H40>=25,H41>=17,H41<21),20-H41,
IF(AND(H40<=28,H40>=25,H41>=21,H41<25),24-H41,
IF(AND(H40<=28,H40>=25,H41>=25,H41<29),H40-H41,
IF(AND(H40<=32,H40>=29,H41<=4),4-H41,
IF(AND(H40<=32,H40>=29,H41>=5,H41<9),8-H41,
IF(AND(H40<=32,H40>=29,H41>=9,H41<13),12-H41,
IF(AND(H40<=32,H40>=29,H41>=13,H41<17),16-H41,
IF(AND(H40<=32,H40>=29,H41>=17,H41<21),20-H41,
IF(AND(H40<=32,H40>=29,H41>=21,H41<25),24-H41,
IF(AND(H40<=32,H40>=29,H41>=25,H41<29),28-H41,
IF(AND(H40<=32,H40>=29,H41>=29,H41<33),H40-H41,
IF(AND(H40<=36,H40>=33,H41<=4),4-H41,
IF(AND(H40<=36,H40>=33,H41>=5,H41<9),8-H41,
IF(AND(H40<=36,H40>=33,H41>=9,H41<13),12-H41,
IF(AND(H40<=36,H40>=33,H41>=13,H41<17),16-H41,
IF(AND(H40<=36,H40>=33,H41>=17,H41<21),20-H41,
IF(AND(H40<=36,H40>=33,H41>=21,H41<25),24-H41,
IF(AND(H40<=36,H40>=33,H41>=25,H41<29),28-H41,
IF(AND(H40<=36,H40>=33,H41>=29,H41<33),32-H41,
IF(AND(H40<=36,H40>=33,H41>=33,H41<37),H40-H41,
IF(AND(H40<=40,H40>=37,H41<=4),4-H41,
IF(AND(H40<=40,H40>=37,H41>=5,H41<9),8-H41,
IF(AND(H40<=40,H40>=37,H41>=9,H41<13),12-H41,
IF(AND(H40<=40,H40>=37,H41>=13,H41<17),16-H41,
IF(AND(H40<=40,H40>=37,H41>=17,H41<21),20-H41,
IF(AND(H40<=40,H40>=37,H41>=21,H41<25),24-H41,
IF(AND(H40<=40,H40>=37,H41>=25,H41<29),28-H41,
IF(AND(H40<=40,H40>=37,H41>=29,H41<33),32-H41,
IF(AND(H40<=40,H40>=37,H41>=33,H41<37),36-H41,
IF(AND(H40<=40,H40>=37,H41>=37,H41<41),H40-H41,
IF(AND(H40<=44,H40>=41,H41<=4),4-H41,
IF(AND(H40<=44,H40>=41,H41>=5,H41<9),8-H41,
IF(AND(H40<=44,H40>=41,H41>=9,H41<13),12-H41,
IF(AND(H40<=44,H40>=41,H41>=13,H41<17),16-H41,
IF(AND(H40<=44,H40>=41,H41>=17,H41<21),20-H41,
IF(AND(H40<=44,H40>=41,H41>=21,H41<25),24-H41,
IF(AND(H40<=44,H40>=41,H41>=25,H41<29),28-H41,
IF(AND(H40<=44,H40>=41,H41>=29,H41<33),32-H41,
IF(AND(H40<=44,H40>=41,H41>=33,H41<37),36-H41,
IF(AND(H40<=44,H40>=41,H41>=37,H41<41),40-H41,
IF(AND(H40<=44,H40>=41,H41>=41,H41<45),H40-H41,
IF(AND(H40<=48,H40>=45,H41<=4),4-H41,
IF(AND(H40<=48,H40>=45,H41>=5,H41<9),8-H41,
IF(AND(H40<=48,H40>=45,H41>=9,H41<13),12-H41,
IF(AND(H40<=48,H40>=45,H41>=13,H41<17),16-H41,
IF(AND(H40<=48,H40>=45,H41>=17,H41<21),20-H41,
IF(AND(H40<=48,H40>=45,H41>=21,H41<25),24-H41,
IF(AND(H40<=48,H40>=45,H41>=25,H41<29),28-H41,
IF(AND(H40<=48,H40>=45,H41>=29,H41<33),32-H41,
IF(AND(H40<=48,H40>=45,H41>=33,H41<37),36-H41,
IF(AND(H40<=48,H40>=45,H41>=37,H41<41),40-H41,
IF(AND(H40<=48,H40>=45,H41>=41,H41<45),44-H41,
IF(AND(H40<=48,H40>=45,H41>=45,H41<49),H40-H41,
IF(AND(H40<=52,H40>=49,H41<=4),4-H41,
IF(AND(H40<=52,H40>=49,H41>=5,H41<9),8-H41,
IF(AND(H40<=52,H40>=49,H41>=9,H41<13),12-H41,
IF(AND(H40<=52,H40>=49,H41>=13,H41<17),16-H41,
IF(AND(H40<=52,H40>=49,H41>=17,H41<21),20-H41,
IF(AND(H40<=52,H40>=49,H41>=21,H41<25),24-H41,
IF(AND(H40<=52,H40>=49,H41>=25,H41<29),28-H41,
IF(AND(H40<=52,H40>=49,H41>=29,H41<33),32-H41,
IF(AND(H40<=52,H40>=49,H41>=33,H41<37),36-H41,
IF(AND(H40<=52,H40>=49,H41>=37,H41<41),40-H41,
IF(AND(H40<=52,H40>=49,H41>=41,H41<45),44-H41,
IF(AND(H40<=52,H40>=49,H41>=45,H41<49),48-H41,
IF(AND(H40<=52,H40>=49,H41>=49,H41<53),H40-H41,
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))