In order to do this computation you have to know two numbers:
Number of tasks done on time
Number of tasks not done on time
Both these numbers would be an aggregation of the entire list.
SharePoint does not provide, out of the box, this sort of aggregate
computations on all the rows in a List. When I need this sort of thing
I use Access and/or Excel to do the computation.