SUMPRODUCT with Hidden Columns

S

Steven

How can I finesse SUMPRODUCT to ignore hidden columns? For example with
column G through M hidden, column D contains resource names, and column F
through AE contain hours:

=SUMPRODUCT(--($d$4:$d125="ResourceName")*($f$4:$ae$125))
 
B

Barb Reinhardt

Your sumproduct won't work because the arrays need to be the same size. You
have one array of $D$4:$D$125 and another with multiple columns. What
exactly do you want to do?
 
H

Harlan Grove

Barb Reinhardt said:
Your sumproduct won't work because the arrays need to be the same size. . . .
....

That DOESN'T matter in this case because the OP's formula passes a
SINGLE argument to SUMPRODUCT. The -- at the beginning of that single
argument is unnecessary. Test it if you don't believe me.

Do you mean there to be no $ between d and 125? I'd guess this was a
typo.

You need to use additional cells in columns F to AE that contain
formulas like

F126:
=(CELL("Width",F126)>0)*NOW()^0

(The NOW call ensures these formulas recalc upon every minimal recalc
rather than just on full recalcs.) Then change your formula to

=SUMPRODUCT(($D$4:$D$125="ResourceName")*($F$126:$AE$126)
*($F$4:$AE$125))
 
B

Barb Reinhardt

I'll check it. Thanks.

Harlan Grove said:
....

That DOESN'T matter in this case because the OP's formula passes a
SINGLE argument to SUMPRODUCT. The -- at the beginning of that single
argument is unnecessary. Test it if you don't believe me.


Do you mean there to be no $ between d and 125? I'd guess this was a
typo.

You need to use additional cells in columns F to AE that contain
formulas like

F126:
=(CELL("Width",F126)>0)*NOW()^0

(The NOW call ensures these formulas recalc upon every minimal recalc
rather than just on full recalcs.) Then change your formula to

=SUMPRODUCT(($D$4:$D$125="ResourceName")*($F$126:$AE$126)
*($F$4:$AE$125))
 
Top