Multiplication of items of two lists

It is a bit tricky in my case. I have a simple ganttchart. Tasks in rows and weeks in columns. Now I am trying to make very bottom line with sums of scheduled hours per week.

So I have database item for every task. Every task has list parametr with list of days (it was only way I found to be able to sum amounts of scheduled days in week). Then every task has parametr workload per day (amount of hours). Now I need to sum subtotals for every task item of amount of hours mutiplied by workload. I have not find other way how to get list than “search”. And in case of search I am not able to make subtotals.