Sample Workbook.xlsx

I'm trying to sum the totals of a column (column I and column J) if a second column (column G and column H) has the text "Y" in it but to not add in if the row cell is blank of the relevant columns. Can anyone advise on the formula. The figures of the column required to be totalled are equal to value of previous cells so are calculated by a cell formula in that column cell.
I hope I'm explaining myself well here.
The sample workbook attached is a short representation of what I'm trying to do, thank you for all help suggested, cheers.