Help to calculate the amount in the table