Sum only if greater than 40 in all subjects

Occasional Visitor
I need some help please,
In Excel If the marks in all subjects are greater than 40 than sum them ,
but,if in any subject marks are less than 40 ,overall sum should be zero.

I mean give "0" if even one value is less than 40
& Give me the sum if all are greater than 40.
1 Reply

@Eraoftime 

Let's say the marks are in B2:B25

=IF(COUNTIF(B2:B25,"<40")=0,SUM(B2:B25),0)