Let's say your values are in cells A1 to A6
The easiest way to do it is to write an intermediate formula.
Write in cells B1 =IF(A1>8;A1-8;0) and extend this formula to B6
Then write in any cell =SUM(B1:B6)
If you wish only one formula