SUMPRODUCT and automatically adjust the height value

ebeyert

Active Member
Joined
Sep 15, 2006
Messages
287
Facts: <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Excel 2007<o:p></o:p>
The following worksheet:<o:p></o:p>
1. HR Planning<o:p></o:p>
2. WBS&Action&Planning<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
In worksheet HR Planning I have the following formula: =SUMPRODUCT(N($F10='WBS&Action&Planning'!$TW$19:$TY$389),OFFSET('WBS&Action&Planning'!$BP$19,0,INDEX((COLUMN(A1)-1)*3,1),381,3))<o:p></o:p>
<o:p></o:p>
This formula works fine except when I add or remove row(s) in worksheet: WBS&Action&Planning between row 19 and 389, I get a #VALUE! , returned as the height in the OFFSET function doesn’t match anymore. <o:p></o:p>
<o:p></o:p>
Question: Is there a way that if I adjust row(s) in worksheet: WBS&Action&Planning (between row 19 and 389) that the height value in the OFFSET formula automatically will adjust as well?<o:p></o:p>
<o:p></o:p>
Thanks in advantage,<o:p></o:p>
Best regards<o:p></o:p>
Ellerd <o:p></o:p>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What type of data do you have in the columns? Numeric or text?

Also, what is the purpose of this formula? I don't recall ever seeing N() being used in a SUMPRODUCT.
 
Upvote 0
Try using this in the hieght argument of Offset

ROWS('WBS&Action&Planning'!$TW$19:$TY$389)
 
Upvote 0
What type of data do you have in the columns? Numeric or text?

Also, what is the purpose of this formula? I don't recall ever seeing N() being used in a SUMPRODUCT.

N() serves the same purpose as --() or ()+0 or ()*1
 
Upvote 0
Thanks all for your quick reply. Jonmo1; your suggestion works :)

=SUMPRODUCT(N($F10='WBS&Action&Planning'!$TW$19:$TY$399),OFFSET('WBS&Action&Planning'!$BP$19,0,INDEX((COLUMN(A1)-1)*3,1),ROWS('WBS&Action&Planning'!$TW$19:$TY$399),3))

Thanks
Ellerd
 
Upvote 0
You can also just NOT specify the height and width of the offset.
If you want the offset to match the hieght and width of the other range, then use the whole range in the offset..

In worksheet HR Planning I have the following formula: =SUMPRODUCT(N($F10='WBS&Action&Planning'!$TW$19:$TY$389),OFFSET('WBS&Action&Planning'!$BP$19:$BR$389,0,INDEX((COLUMN(A1)-1)*3,1)))

Offset will move the specified number of rows/collumns.
If Hieght/Width are omitted, it defaults to use the same hieght/width of the original offset range.
 
Last edited:
Upvote 0
Interesting - does it hold any advantage over any of those other methods?

I don't see any advantage to it...
If anything, the other methods are probably more efficient by not calling another function...

Sounds like a question for Barry or Aladin.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top