How to use only visible cells in LibreOffice functions?

Hello,

I have a filtered data on a sheet and some formulas uses that filtered column. When i filter that column How can i use only visible cells in libreoffice functions? I need a general answer not for only SUM

image description

You can use function AGGREGATE

https://help.libreoffice.org/6.0/en-US/text/scalc/01/func_aggregate.html

Thanks for reply but I will use it with
COUNTIF
SUMPRODUCT
COUNTIFS

function list doesn’t contain any idea about