+ Reply to Thread
Results 1 to 9 of 9

Finding an average across multiple worksheets in the same workbook

  1. #1
    Registered User
    Join Date
    02-01-2007
    Posts
    8

    Finding an average across multiple worksheets in the same workbook

    Hi all,

    I'm trying to get averages for different values across a years worth of worksheets (Jan-Dec). Each worksheet contains an account number (column A has various accounts such as "shipping" and "cost of sales"). The total for these values is located in column D.

    Some of the account numbers are the same across all 12 worksheets, but with different totals, of which I'm trying to average. Basically what I'd like the formula on my "Averages" worksheet to do is to look across the twelve worksheets, find the total values for each account, and average them out. So if January has "Shipping" in column A, I want the average total of all the worksheets that contain "Shipping", keeping in mind that maybe only 8 of the 12 worksheets have "Shipping" in column A.

    On that same note, there are sub accounts in column B that also have totals...i.e. Under the head account of "Shipping" there might be a "Foreign" sub account, which also has a total that I'd like to average, but keep them all separated by the head account.

    I kind of rambled, but I gotta think there's an easy way to to this...any help would be greatly appreciated!!

    Thanks!

  2. #2
    Registered User
    Join Date
    02-01-2007
    Posts
    8
    I've attached a pic of what the spreadsheet looks like...each month has similar data, but not everything is the same or included on each worksheet.
    Attached Images Attached Images

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Average From Different WorkSheets

    =AVERAGE(Sheet2:Sheet6!A1)

    So then this should work

    =AVERAGE(Jan:Dec!A1)
    Last edited by davesexcel; 03-15-2007 at 07:17 PM.

  4. #4
    Registered User
    Join Date
    02-01-2007
    Posts
    8
    Hi Dave,

    Thanks...that would work, but I need the results to be specific to the header title, which isn't in the same location in column A on each sheet.

    I need something like "look for value XX in column A of all 12 sheets, and find the average of the value in column D in the same row as value XX", and so on. Is that possible?

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    I'm afraid you'll need some VBA here.
    For the future have a look at these tips for proper database design http://www.ozgrid.com/forum/announcement.php?f=46&a=6
    Far less headaches

    Good luck !

  6. #6
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by GYG
    Hi Dave,

    Thanks...that would work, but I need the results to be specific to the header title, which isn't in the same location in column A on each sheet.

    I need something like "look for value XX in column A of all 12 sheets, and find the average of the value in column D in the same row as value XX", and so on. Is that possible?

    List your worksheets tabs names in column C starting with cell C3 in your average worksheet and input formula in cell D3.


    =SUMPRODUCT(SUMIF(INDIRECT("'"&C3:C14&"'!A4:A100"),D3,INDIRECT("'"&C3:C14&"'!D4:D100")))/SUMPRODUCT((T(OFFSET(INDIRECT("'"&C3:C14&"'!A4:A100"),COLUMN(INDIRECT("4:30"))-4,0,1,1))=D3)*(N(OFFSET(INDIRECT("'"&C3:C14&"'!D4:D100"),COLUMN(INDIRECT("4:30"))-4,0,1,1))<>""))


    Hope it helps!

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480
    Quote Originally Posted by GYG
    Hi Dave,

    Thanks...that would work, but I need the results to be specific to the header title, which isn't in the same location in column A on each sheet.

    I need something like "look for value XX in column A of all 12 sheets, and find the average of the value in column D in the same row as value XX", and so on. Is that possible?
    I suppose you could name a formula for each sheet, then get the average for each formula??
    I don't know, just a suggestion....

  8. #8
    Registered User
    Join Date
    02-01-2007
    Posts
    8
    Quote Originally Posted by vane0326
    List your worksheets tabs names in column C starting with cell C3 in your average worksheet and input formula in cell D3.


    =SUMPRODUCT(SUMIF(INDIRECT("'"&C3:C14&"'!A4:A100"),D3,INDIRECT("'"&C3:C14&"'!D4:D100")))/SUMPRODUCT((T(OFFSET(INDIRECT("'"&C3:C14&"'!A4:A100"),COLUMN(INDIRECT("4:30"))-4,0,1,1))=D3)*(N(OFFSET(INDIRECT("'"&C3:C14&"'!D4:D100"),COLUMN(INDIRECT("4:30"))-4,0,1,1))<>""))


    Hope it helps!
    Hmmm...it's telling me there's a circular reference...pic attached...
    Attached Images Attached Images

  9. #9
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by GYG
    Hmmm...it's telling me there's a circular reference...pic attached...

    Sorry about that. Try...


    =SUMPRODUCT(SUMIF(INDIRECT("'"&C3:C14&"'!A4:A100"),"Shipping",INDIRECT("'"&C3:C14&"'!D4:D100")))/SUMPRODUCT((T(OFFSET(INDIRECT("'"&C3:C14&"'!A4:A10 0"),COLUMN(INDIRECT("4:30"))-4,0,1,1))="Shipping")*(N(OFFSET(INDIRECT("'"&C3:C14&"'!D4: D100"),COLUMN(INDIRECT("4:30"))-4,0,1,1))<>""))


    Hope it helps!

+ 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