Hi,
If the hidden rows is caused by applying filter(s) (by AutoFilter or AdvancedFilter), and not by set them manually by hand, then you don't need UDF at all. All that you need is SUMIFS() or SUMPRODUCT() formula (and you are already using it).
Even if you set the rows hidden manually, you can still use the SUMIFS() or SUMPRODUCT() with a helper column.
For example, your current function :
Put this function on Data!M3 and copy down:
Then replace the sum range in the original function with this helper column :
---------------------------------------
But if you insist to use an UDF, this is the code :
I set the parameter syntax of this function is exactly the same as parameter of SUMIFS() formula, that is :
- The first parameter is the range of area to be summed
- The follower parameter is pair(s) of "Range - Criteria", the syntax is same as the SUMIFS() formula
For example :
Regards
Bookmarks