+ Reply to Thread
Page 1 of 2 1
Results 1 to 200 of 204

Using Name as Worksheet Reference

  1. #1
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117

    Using Name as Worksheet Reference

    I have a defined name that holds the names of each relevant worksheet I want to calculate.

    Lets Say I want to sum every A1 in each worksheet in the defined name. How would I go about doing that?
    -Joseph

  2. #2
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  3. #3
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  4. #4
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  5. #5
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    Quote Originally Posted by Biff
    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff
    I'm getting a #Name? error with this. I checked it out and the error comes from this:

    ""&SheetNames&"

    I have NO clue how this worksheet function is supposed to work. Especially the N before the INDIRECT function. Can you explain that a little bit??

    Thanks

  6. #6
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  7. #7
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  8. #8
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    Awesome, got it!

    Now I need to figure out how to use this with certain criteria...hmmmm



    But anyway thanks again Biff and Peo.
    Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA Function. Guess I should have specified. Sorry

  9. #9
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  10. #10
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  11. #11
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  12. #12
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  13. #13
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  14. #14
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  15. #15
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  16. #16
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  17. #17
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  18. #18
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  19. #19
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  20. #20
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  21. #21
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  22. #22
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  23. #23
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  24. #24
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  25. #25
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  26. #26
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  27. #27
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  28. #28
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  29. #29
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  30. #30
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  31. #31
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  32. #32
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  33. #33
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  34. #34
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  35. #35
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  36. #36
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  37. #37
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  38. #38
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  39. #39
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  40. #40
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  41. #41
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  42. #42
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  43. #43
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  44. #44
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  45. #45
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  46. #46
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  47. #47
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  48. #48
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  49. #49
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  50. #50
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  51. #51
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  52. #52
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  53. #53
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  54. #54
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  55. #55
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  56. #56
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  57. #57
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  58. #58
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  59. #59
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  60. #60
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  61. #61
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  62. #62
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  63. #63
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  64. #64
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  65. #65
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  66. #66
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  67. #67
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  68. #68
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  69. #69
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  70. #70
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  71. #71
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  72. #72
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  73. #73
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  74. #74
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  75. #75
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  76. #76
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  77. #77
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  78. #78
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  79. #79
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  80. #80
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  81. #81
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  82. #82
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  83. #83
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  84. #84
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  85. #85
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  86. #86
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  87. #87
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  88. #88
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  89. #89
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  90. #90
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  91. #91
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  92. #92
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  93. #93
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  94. #94
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  95. #95
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    Quote Originally Posted by Biff
    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >
    Two things:
    1st Off, what the hell's wrong with this thread? Why is it repeating itself a rediculous amount of times?????

    2nd, The SUMIF function is not working for me. I'm looking for something along the lines of:

    Sheet1
    C1:2 D1:Yes

    Sheet2
    C1:2 D1:Yes

    Sheet3
    C1:2 D1:No

    Here is the formula that I have to add every C1 in worksheets from Range "Employees" (Defined Name):

    =SUMPRODUCT(N(INDIRECT("'"&Employees&"'!C1")))

    How can I sum the worksheets from Range "Employees"C1 where D1=Yes???

  96. #96
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  97. #97
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  98. #98
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  99. #99
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  100. #100
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  101. #101
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  102. #102
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  103. #103
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    Okay, I figured that part out.

    =SUMPRODUCT((T(INDIRECT("'"&Employees&"'!D1"))="Yes")*(N(INDIRECT("'"&Employees&"'!C1"))))

    NOW what my REAL criteria is:
    B2=1-Jan
    A4=Hitachi 717

    Formula is in B4.

    What I'm looking for from this is to sum the values in each "Employees" sheet in the column that equals 1-Jan (from B2) and in the row that equals "Hitachi 717".

    Here's what I came up with, but it's not working.

    =SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))

    In every "Employees" sheet in row 1:1 is the Date value. And in Column A:A in every "Employees" sheet is where "Hitachi 717" would be found. Where these two will intersect is what I want to sum.

    Any ideas??

  104. #104
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  105. #105
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  106. #106
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  107. #107
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  108. #108
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  109. #109
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  110. #110
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  111. #111
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  112. #112
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  113. #113
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  114. #114
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  115. #115
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  116. #116
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  117. #117
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  118. #118
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  119. #119
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  120. #120
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  121. #121
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  122. #122
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  123. #123
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  124. #124
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  125. #125
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  126. #126
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  127. #127
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  128. #128
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  129. #129
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  130. #130
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  131. #131
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  132. #132
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  133. #133
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  134. #134
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  135. #135
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  136. #136
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  137. #137
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  138. #138
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  139. #139
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  140. #140
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  141. #141
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  142. #142
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  143. #143
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  144. #144
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  145. #145
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  146. #146
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  147. #147
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  148. #148
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  149. #149
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  150. #150
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  151. #151
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  152. #152
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  153. #153
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  154. #154
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  155. #155
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  156. #156
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  157. #157
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  158. #158
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  159. #159
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  160. #160
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  161. #161
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  162. #162
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  163. #163
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  164. #164
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  165. #165
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  166. #166
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  167. #167
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  168. #168
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  169. #169
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  170. #170
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  171. #171
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  172. #172
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  173. #173
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  174. #174
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  175. #175
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  176. #176
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  177. #177
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  178. #178
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  179. #179
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  180. #180
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  181. #181
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  182. #182
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  183. #183
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  184. #184
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  185. #185
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  186. #186
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  187. #187
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  188. #188
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  189. #189
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  190. #190
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  191. #191
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  192. #192
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



  193. #193
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    > Now I need to figure out how to use this with certain criteria


    Depends on what you want to do.

    You might be able to use something like:

    =SUMPRODUCT(SUMIF(..................................

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Awesome, got it!
    >
    > Now I need to figure out how to use this with certain criteria...hmmmm
    >
    >
    >
    >
    > But anyway thanks again Biff and Peo.
    > Bruno, thanks for the VBA but I kinda wanted to avoid using a VBA
    > Function. Guess I should have specified. Sorry
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  194. #194
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    malik641 wrote...
    ....
    >NOW what my REAL criteria is:
    >B2=1-Jan
    >A4=Hitachi 717
    >
    >Formula is in B4.
    >
    >What I'm looking for from this is to sum the values in each "Employees"
    >sheet in the column that equals 1-Jan (from B2) and in the row that
    >equals "Hitachi 717".
    >
    >Here's what I came up with, but it's not working.
    >
    >=SUMPRODUCT((N(INDIRECT("'"&Employees&"'!$1:$1))=B$2)*(T(INDIRECT("'"&Employees&"'!$A:$A"))=$A4))
    >
    >In every "Employees" sheet in row 1:1 is the Date value. And in Column
    >A:A in every "Employees" sheet is where "Hitachi 717" would be found.
    >Where these two will intersect is what I want to sum.
    >
    >Any ideas??


    You can't do this if your A4 value could be anywhere in col A in the
    other worksheets *AND* your B2 value could be anywhere in row 1 in the
    other worksheets. If that were the case, you'd need a 3D array or some
    means of isolating the appropriate column in each worksheet separately.
    Neither are possible.

    However, if all the employee worksheets would have the same row 1, so
    1-Jan would be in the same column in every employee worksheet, you
    could use

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Employees&"'!A:A"),$A4,
    INDIRECT("'"&Employees&"'!C"&
    MATCH(B$2,INDIRECT("'"&INDEX(Employees,1)&"'!1:1"),0),0)))


  195. #195
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.


    Do you mean a Collection of worksheets you want to calculate?

    -------------------------------------
    Dim i, SumOfA1Cells as Currency
    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i).[a1])
    Next
    -------------------------------------

    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?


    Or, for any worksheet in active workbook:
    --------------------------------------------
    Dim i, SumOfA1Cells As Currency
    For Each i In ThisWorkbook.Worksheets
    SumOfA1Cells = SumOfA1Cells + Sheets(i.Name).[a1]
    Next
    --------------------------------------------

    Bruno



  196. #196
    Bruno Campanini
    Guest

    Re: Using Name as Worksheet Reference

    "Bruno Campanini" <[email protected]> wrote in message
    news:[email protected]...

    Ooops!

    That's better:

    For Each i In NameOfSheets
    SumOfA1Cells = SumOfA1Cells + Val(Sheets(i.Name).[a1])
    Next

    Bruno



  197. #197
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Try this:

    J1 = Sheet1
    J2 = Sheet3
    J3 = Sheet10

    J1:J3 is given the defined name SheetNames

    =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))

    This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a defined name that holds the names of each relevant worksheet I
    > want to calculate.
    >
    > Lets Say I want to sum every A1 in each worksheet in the defined name.
    > How would I go about doing that?
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  198. #198
    Peo Sjoblom
    Guest

    Re: Using Name as Worksheet Reference

    You need to give the range a name (insert>name>define) as per your
    instructions

    "J1:J3 is given the defined name SheetNames"

    or use the range as in

    =SUMPRODUCT(N(INDIRECT("'"&J1:J3&"'!A1")))


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >



  199. #199
    Biff
    Guest

    Re: Using Name as Worksheet Reference

    Hi!

    Peo explained the #NAME? problem.

    As far as N goes.......

    I don't know the exact reason it's needed. It's one of those quirky type
    things you just run into.

    It usually comes into play when you're trying to deal with 3D references.
    For some reason if you just used:

    =SUMPRODUCT(INDIRECT("'"&SheetNames&"'!A1"))

    The arguments to INDIRECT will return #VALUE! errors. Using N (in this case)
    causes the arguments to actually return their true values. The N() function
    is used for numeric values and the T() function is used for text values.

    If you only wanted to sum the same cell on 3 different sheets I would just
    use:

    =SUM(Sheet1!A1,Sheet3!A1,Sheet10!A1)

    The SUMPRODUCT method is good if you have many sheets to sum.

    Biff

    "malik641" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Biff Wrote:
    >> Hi!
    >>
    >> Try this:
    >>
    >> J1 = Sheet1
    >> J2 = Sheet3
    >> J3 = Sheet10
    >>
    >> J1:J3 is given the defined name SheetNames
    >>
    >> =SUMPRODUCT(N(INDIRECT("'"&SheetNames&"'!A1")))
    >>
    >> This will SUM Sheet1!A1, Sheet3!A1, Sheet10!A1
    >>
    >> Biff

    > I'm getting a #Name? error with this. I checked it out and the error
    > comes from this:
    >
    > ""&SheetNames&"
    >
    > I have NO clue how this worksheet function is supposed to work.
    > Especially the N before the INDIRECT function. Can you explain that a
    > little bit??
    >
    > Thanks
    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile:
    > http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=401807
    >




  200. #200
    Harlan Grove
    Guest

    Re: Using Name as Worksheet Reference

    "Biff" wrote...
    ....
    >As far as N goes.......
    >
    >I don't know the exact reason it's needed. It's one of those
    >quirky type things you just run into.
    >
    >It usually comes into play when you're trying to deal with
    >3D references.

    ....

    It's not 3D referencing. Calling INDIRECT or OFFSET with array arguments
    results in those functions returning something that behaves like an array of
    range references. There are very few other functions that can cope with such
    beasts, certainly not SUMPRODUCT. N and T functions convert these into
    arrays of numbers or strings, which SUMPRODUCT can handle.



+ Reply to Thread
Page 1 of 2 1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1