I want to use more than 30 arguments in sum formula for excel, I am using below formula:-
=SUM(IF(AND(ISNUMBER($F$73),ISNUMBER($J$73)),PRODUCT($F$73,$J$73/100),0),IF(AND(ISNUMBER($G$74),ISNUMBER($J$74)),PRODUCT($G$74,$J$74),0))
Above formula will work fine for 30 argumnets, but for more than 30 argumemts excel will return error(#VALUE
)
You could batch smaller groups into sub-SUMs like this:
=SUM(SUM(1,2), SUM(3,4),...)
.Perhaps you could save further characters in your formula like this:
which could be extended much further, but for clarity, I'd suggest writing a custom UDF:
SPRange would work like SUMPRODUCT but operates on multiple ranges:
If you want to extend to many ranges you can define names through code:
which allows for over 1000 cells in my tests. Then just enter the formula as:
This version will be shorter, you can add as many as you want, only limit will be maximum formula length
=(COUNT(F73,J73)=2)*(F73*J73/100)+(COUNT(G74,J74)=2)*(G74*J74/100)