Re: The Longest formula ever

This are my two cents....

=IF(IF(IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X7:Y7),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X8:Y8),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8)),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X7:Y7),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X8:Y8),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8)),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X9:Y9),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8,IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X10:Y10),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8+AA10))),IF(IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X7:Y7),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X8:Y8),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8)),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X7:Y7),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X8:Y8),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8)),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X9:Y9),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8,IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X10:Y10),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8+AA10))),IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X10:Y10),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8+AA10,IF(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))=MEDIAN(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))-INT(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24))))),X11:Y11),(IF(WEEKDAY(H12,2)=6,H12+2,IF(WEEKDAY(H12,2)=7,H12+1,(H12+(M12/24)))))+AA8+AA10)))