Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic Sum

34 views
Skip to first unread message

Steve

unread,
Apr 5, 2007, 4:17:31 PM4/5/07
to
Hello. I have 5 sheets (named Sheet1 though Sheet5). On an input
sheet, I wrote sheet1 though sheet5 in cells A2:A6, with a 1 or 0 in
column B. Is there a way sum cell A1 in each of the sheets that have
a 1 next to it in column B?

Bill Kuunders

unread,
Apr 5, 2007, 4:58:24 PM4/5/07
to
One way,

=IF(B2=1,Sheet1!A1,0)+IF(B3=1,Sheet2!A1,0)+IF(B4=1,Sheet3!A1,0)+IF(B5=1,Sheet4!A1,0)+IF(B6=1,Sheet5!A1,0)

Greetings from New Zealand

"Steve" <steve_a...@yahoo.com> wrote in message
news:1175804251.2...@d57g2000hsg.googlegroups.com...

T. Valko

unread,
Apr 5, 2007, 5:11:54 PM4/5/07
to
If you only have a "few" sheets then I would probably use Bill's suggestion.

If you have "a lot" of sheets then this will work:

Give your list of sheet names a defined name. Something like sNames.

Then:

=SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNames&"'!A1")))

Biff

"Steve" <steve_a...@yahoo.com> wrote in message
news:1175804251.2...@d57g2000hsg.googlegroups.com...

Steve

unread,
Apr 5, 2007, 5:27:49 PM4/5/07
to
Hi Biff. Thanks so much for the response. I hate to sound dumb, but
can you elaborate a little? How do I create a defined name for all
the sheets? And do I create it for ALL the sheet names?

Thanks Biff!!


On Apr 5, 5:11 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> If you only have a "few" sheets then I would probably use Bill's suggestion.
>
> If you have "a lot" of sheets then this will work:
>
> Give your list of sheet names a defined name. Something like sNames.
>
> Then:
>

> =SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNa­mes&"'!A1")))
>
> Biff
>
> "Steve" <steve_andrus...@yahoo.com> wrote in message


>
> news:1175804251.2...@d57g2000hsg.googlegroups.com...
>
>
>
> > Hello. I have 5 sheets (named Sheet1 though Sheet5). On an input
> > sheet, I wrote sheet1 though sheet5 in cells A2:A6, with a 1 or 0 in
> > column B. Is there a way sum cell A1 in each of the sheets that have

> > a 1 next to it in column B?- Hide quoted text -
>
> - Show quoted text -


Steve

unread,
Apr 5, 2007, 5:40:14 PM4/5/07
to
Biff,

Disregard previous post. I got it! I have one follow up question if
I may - is it possible to make the cell being summed (in this case A1)
dynamic as well? Meaning, if I copy the formula down one row, can I
get it to sum cell B1? Thanks!

On Apr 5, 5:11 pm, "T. Valko" <biffinp...@comcast.net> wrote:

> If you only have a "few" sheets then I would probably use Bill's suggestion.
>
> If you have "a lot" of sheets then this will work:
>
> Give your list of sheet names a defined name. Something like sNames.
>
> Then:
>

> =SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNa­mes&"'!A1")))
>
> Biff
>

> "Steve" <steve_andrus...@yahoo.com> wrote in message


>
> news:1175804251.2...@d57g2000hsg.googlegroups.com...
>
>
>
> > Hello. I have 5 sheets (named Sheet1 though Sheet5). On an input
> > sheet, I wrote sheet1 though sheet5 in cells A2:A6, with a 1 or 0 in
> > column B. Is there a way sum cell A1 in each of the sheets that have

T. Valko

unread,
Apr 5, 2007, 5:49:30 PM4/5/07
to
OK....

Assume on your Input sheet you have:

A2 = Sheet1
A3 = Sheet2
A4 = Sheet3
A5 = Sheet4
A6 = Sheet5

Select the range A2:A6
Click in the Name box (that box directly above the "A" in column A) and type
in a name for that range. I used the name sNames in my example. sNames for
sheet names.

That's the easy way to assign a name to range. Another way:

Goto the menu Insert>Name>Define
Names in workbook: type the name in here: sNames
Refers to: =Input!$A$2:$A$6
OK out

Biff

"Steve" <steve_a...@yahoo.com> wrote in message

news:1175808469.7...@n59g2000hsh.googlegroups.com...


Hi Biff. Thanks so much for the response. I hate to sound dumb, but
can you elaborate a little? How do I create a defined name for all
the sheets? And do I create it for ALL the sheet names?

Thanks Biff!!


On Apr 5, 5:11 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> If you only have a "few" sheets then I would probably use Bill's
> suggestion.
>
> If you have "a lot" of sheets then this will work:
>
> Give your list of sheet names a defined name. Something like sNames.
>
> Then:
>

> =SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNa衫es&"'!A1")))

T. Valko

unread,
Apr 5, 2007, 6:27:52 PM4/5/07
to
>if I copy the formula down one row, can I
>get it to sum cell B1?

Do you mean if you copy it *across* a row?

Ok, now you're getting a little "hairy"!

=SUMPRODUCT(SUMIF(OFFSET($B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNames&"'!"&CHAR(COLUMNS($A:A)+64)&"1")))

That'll work up to Z1.

After that, you're on your own!

Biff

"Steve" <steve_a...@yahoo.com> wrote in message

news:1175809214.6...@o5g2000hsb.googlegroups.com...
Biff,

Disregard previous post. I got it! I have one follow up question if
I may - is it possible to make the cell being summed (in this case A1)
dynamic as well? Meaning, if I copy the formula down one row, can I
get it to sum cell B1? Thanks!

On Apr 5, 5:11 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> If you only have a "few" sheets then I would probably use Bill's
> suggestion.
>
> If you have "a lot" of sheets then this will work:
>
> Give your list of sheet names a defined name. Something like sNames.
>
> Then:
>

> =SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNa衫es&"'!A1")))

Roger Govier

unread,
Apr 5, 2007, 7:38:38 PM4/5/07
to
Hi Biff

Maybe the following would allow you to go past Z1

=SUMPRODUCT(SUMIF(OFFSET($B2,ROW(B2:B6)-
MIN(ROW(B2:B6)),),1,
INDIRECT("'"&sNames&"'!"&ADDRESS(1,COLUMN(A1),4))))

--
Regards

Roger Govier


"T. Valko" <biffi...@comcast.net> wrote in message
news:OJYwqG9d...@TK2MSFTNGP05.phx.gbl...

T. Valko

unread,
Apr 5, 2007, 10:00:55 PM4/5/07
to
Yeah, that'll work. In fact, that is less confusing than:

CHAR(COLUMNS($A:A)+64)&"1"

Biff

"Roger Govier" <ro...@technologyNOSPAM4u.co.uk> wrote in message
news:uOWlVu9d...@TK2MSFTNGP06.phx.gbl...

Steve

unread,
Apr 6, 2007, 10:04:24 AM4/6/07
to
Thanks guys!! Much appreciated!

On Apr 5, 10:00 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> Yeah, that'll work. In fact, that is less confusing than:
>
> CHAR(COLUMNS($A:A)+64)&"1"
>
> Biff
>

> "Roger Govier" <r...@technologyNOSPAM4u.co.uk> wrote in message


>
> news:uOWlVu9d...@TK2MSFTNGP06.phx.gbl...
>
>
>
> > Hi Biff
>
> > Maybe the following would allow you to go past Z1
>
> > =SUMPRODUCT(SUMIF(OFFSET($B2,ROW(B2:B6)-
> > MIN(ROW(B2:B6)),),1,
> > INDIRECT("'"&sNames&"'!"&ADDRESS(1,COLUMN(A1),4))))
>
> > --
> > Regards
>
> > Roger Govier
>

> > "T. Valko" <biffinp...@comcast.net> wrote in message


> >news:OJYwqG9d...@TK2MSFTNGP05.phx.gbl...
> >> >if I copy the formula down one row, can I
> >>>get it to sum cell B1?
>
> >> Do you mean if you copy it *across* a row?
>
> >> Ok, now you're getting a little "hairy"!
>

> >> =SUMPRODUCT(SUMIF(OFFSET($B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sN­ames&"'!"&CHAR(COLUMNS($A:A)+64)&"1")))


>
> >> That'll work up to Z1.
>
> >> After that, you're on your own!
>
> >> Biff
>

> >> "Steve" <steve_andrus...@yahoo.com> wrote in message

> >>news:1175809214.6...@o5g2000hsb.googlegroups.com...
> >> Biff,
>
> >> Disregard previous post. I got it! I have one follow up question if
> >> I may - is it possible to make the cell being summed (in this case A1)
> >> dynamic as well? Meaning, if I copy the formula down one row, can I
> >> get it to sum cell B1? Thanks!
>
> >> On Apr 5, 5:11 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> >>> If you only have a "few" sheets then I would probably use Bill's
> >>> suggestion.
>
> >>> If you have "a lot" of sheets then this will work:
>
> >>> Give your list of sheet names a defined name. Something like sNames.
>
> >>> Then:
>

> >>> =SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNa­­mes&"'!A1")))


>
> >>> Biff
>
> >>> "Steve" <steve_andrus...@yahoo.com> wrote in message
>
> >>>news:1175804251.2...@d57g2000hsg.googlegroups.com...
>
> >>> > Hello. I have 5 sheets (named Sheet1 though Sheet5). On an input
> >>> > sheet, I wrote sheet1 though sheet5 in cells A2:A6, with a 1 or 0 in
> >>> > column B. Is there a way sum cell A1 in each of the sheets that have
> >>> > a 1 next to it in column B?- Hide quoted text -
>

> >>> - Show quoted text -- Hide quoted text -

T. Valko

unread,
Apr 6, 2007, 2:07:08 PM4/6/07
to
You're welcome. Thanks for the feedback!

Biff

"Steve" <steve_a...@yahoo.com> wrote in message

news:1175868264....@q75g2000hsh.googlegroups.com...
Thanks guys!! Much appreciated!

On Apr 5, 10:00 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> Yeah, that'll work. In fact, that is less confusing than:
>
> CHAR(COLUMNS($A:A)+64)&"1"
>
> Biff
>
> "Roger Govier" <r...@technologyNOSPAM4u.co.uk> wrote in message
>
> news:uOWlVu9d...@TK2MSFTNGP06.phx.gbl...
>
>
>
> > Hi Biff
>
> > Maybe the following would allow you to go past Z1
>
> > =SUMPRODUCT(SUMIF(OFFSET($B2,ROW(B2:B6)-
> > MIN(ROW(B2:B6)),),1,
> > INDIRECT("'"&sNames&"'!"&ADDRESS(1,COLUMN(A1),4))))
>
> > --
> > Regards
>
> > Roger Govier
>
> > "T. Valko" <biffinp...@comcast.net> wrote in message
> >news:OJYwqG9d...@TK2MSFTNGP05.phx.gbl...
> >> >if I copy the formula down one row, can I
> >>>get it to sum cell B1?
>
> >> Do you mean if you copy it *across* a row?
>
> >> Ok, now you're getting a little "hairy"!
>

> >> =SUMPRODUCT(SUMIF(OFFSET($B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sN苔mes&"'!"&CHAR(COLUMNS($A:A)+64)&"1")))


>
> >> That'll work up to Z1.
>
> >> After that, you're on your own!
>
> >> Biff
>
> >> "Steve" <steve_andrus...@yahoo.com> wrote in message
> >>news:1175809214.6...@o5g2000hsb.googlegroups.com...
> >> Biff,
>
> >> Disregard previous post. I got it! I have one follow up question if
> >> I may - is it possible to make the cell being summed (in this case A1)
> >> dynamic as well? Meaning, if I copy the formula down one row, can I
> >> get it to sum cell B1? Thanks!
>
> >> On Apr 5, 5:11 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> >>> If you only have a "few" sheets then I would probably use Bill's
> >>> suggestion.
>
> >>> If you have "a lot" of sheets then this will work:
>
> >>> Give your list of sheet names a defined name. Something like sNames.
>
> >>> Then:
>

> >>> =SUMPRODUCT(SUMIF(OFFSET(B2,ROW(B2:B6)-MIN(ROW(B2:B6)),),1,INDIRECT("'"&sNa限mes&"'!A1")))

0 new messages