+ Reply to Thread
Results 1 to 4 of 4

Trouble with Average & Indirect Function

  1. #1
    Registered User
    Join Date
    09-09-2003
    Location
    NY
    Posts
    14

    Trouble with Average & Indirect Function

    First off, cell B1 contains the name of a sheet (sheet1) and cell B2 contains the name of another sheet (sheet7). I want to get the average of cell B6 from sheets 1-7.

    I can accomplish this by using the following formula:

    SUM('sheet1:sheet7'!B6)

    however it may not always be sheets1-7, sometimes it might be 4-8, etc. which is why I need to have the input cells (B1,B2)

    I have tried using indirect and Average and I keep getting a #REF error. Here is the formula I've been trying. Am I missing something?

    SUM(INDIRECT("'"&B1&":"&B2&"'!B6"))

    It seems to me that this should be the exact copy of a regular sum function

  2. #2
    Registered User
    Join Date
    09-09-2003
    Location
    NY
    Posts
    14
    This is really irritating me...no matter how I manipulate this function I can't get it to work...should I be using a different function instead?

  3. #3
    Registered User
    Join Date
    02-28-2005
    Posts
    16
    Try using sum(indirect(address())).

    The address() function returns a pointer to a cell reference, and the indirect function returns the value of that cell.

  4. #4
    Registered User
    Join Date
    09-09-2003
    Location
    NY
    Posts
    14
    I tried the address function but the only problem is that it places the sheet name inside apostraphes ( 'sheet1'!) but I need to have the apostraphes around the range of sheets.

    When I break down the function into its seperate parts it works out, but when I put them all together I get either #REF! or #VALUE!. I don't know if this is just a quirky thing or if I'm missing something. Maybe I'm going about this the wrong way...is there a different function I need to use or is the function just bad syntax somewhere that I'm missing?
    -Clay

+ 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