I have the following formula:
=IF([@[Month Num]]<>Y4,SUMIF(Y:Y,[@[Month Num]],P:P),"")
I am wanting to add an aggregate function to the formula, so that when the formula comes up with the SUM result it will not include hidden rows.

I was given the suggestion of using aggregate function, but after hours research and trying for myself how to incorporate it into my formula, i still cant figure it out. I know that im not the sharpest tool in the block, but i have tried. It's doing my head in
Any help would be appreciated