I posted this formula earlier...
=IF(OR(COUNTIF(D2:F2,"<4"),G2<5),0,18+9*(G2>=7))
Please describe in what way it is not working for you.
Also, I notice you have the letter 'n' appearing at some locations within Columns D:F... how did you want the formula to handle them (being they are not numbers)... Ignore them? Treat them as if they were 0? Something else?