How to add up values based on background?

Exactly this problem: Calc: sum cells values having same background color

Except I am new to libre office and still dont understand how their replies fixed the problem, please help.

thanks!