ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUMPRODUCT with Hidden Columns (https://www.excelbanter.com/excel-worksheet-functions/141877-sumproduct-hidden-columns.html)

steven

SUMPRODUCT with Hidden Columns
 
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))


Barb Reinhardt

SUMPRODUCT with Hidden Columns
 
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?

"Steven" wrote:

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))


Harlan Grove[_2_]

SUMPRODUCT with Hidden Columns
 
Barb Reinhardt wrote...
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.

"Steven" wrote:
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))


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))


Barb Reinhardt

SUMPRODUCT with Hidden Columns
 
I'll check it. Thanks.

"Harlan Grove" wrote:

Barb Reinhardt wrote...
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.

"Steven" wrote:
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))


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))




All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com