+ Reply to Thread
Results 1 to 2 of 2

Dynamic reference to sheet name

  1. #1
    Darien0104
    Guest

    Dynamic reference to sheet name

    How can I insert a variable or cell value into a function to make the
    reference (or worksheet) dynamic?

    Imagine that there are four worksheets named: Summary, apples, oranges and
    bananas. On the Summary sheet the first column contains one of the other
    worksheet names, eg all values in column A contain one of the worksheet
    names: apples, oranges or bananas. Cells in other columns contain references
    that leverage the worksheet names in column A. For instance, something like
    the following:
    =average(<A1>!B1:B30)
    =average(<A2>!B1:B30)

    My question is, what should I replace <A1> with such that it substitutes in
    the value from the first column which will match one of the worksheets in the
    workbook?

  2. #2
    Aladin Akyurek
    Guest

    Re: Dynamic reference to sheet name

    Darien0104 wrote:
    > How can I insert a variable or cell value into a function to make the
    > reference (or worksheet) dynamic?
    >
    > Imagine that there are four worksheets named: Summary, apples, oranges and
    > bananas. On the Summary sheet the first column contains one of the other
    > worksheet names, eg all values in column A contain one of the worksheet
    > names: apples, oranges or bananas. Cells in other columns contain references
    > that leverage the worksheet names in column A. For instance, something like
    > the following:
    > =average(<A1>!B1:B30)
    > =average(<A2>!B1:B30)
    >
    > My question is, what should I replace <A1> with such that it substitutes in
    > the value from the first column which will match one of the worksheets in the
    > workbook?


    =AVERAGE(INDIRECT("'"&A1&"'!B1:B30"))


+ Reply to Thread

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