+ Reply to Thread
Results 1 to 7 of 7

Y-T-D averages

Hybrid View

LaD Y-T-D averages 09-22-2007, 11:04 AM
FrankBoston Maybe this idea will help.... 09-22-2007, 11:25 AM
LaD How would the formula look if... 09-22-2007, 02:14 PM
FrankBoston Uploading your workbook would... 09-22-2007, 05:24 PM
LaD Here's the zip file. 09-23-2007, 01:39 PM
FrankBoston SumProduct used and explained 09-23-2007, 02:53 PM
LaD Absolutely incredible! I have... 09-23-2007, 03:36 PM
  1. #1
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302
    Maybe this idea will help. Say your values are in B4:B9, then the following will average only the non-zero values.
    =SUM(B4:B9)/COUNTIF(B4:B9,"<>0")
    FrankBoston is the pen name for Andrew Garland, Lexington MA

  2. #2
    Registered User
    Join Date
    09-22-2007
    Posts
    4
    How would the formula look if I want to average different groups of cells like B4:B9 and B14:B19 and B23:B28 for example? To get my y-t-d averages I'll be pulling numbers from 1Q, then 1Q & 2Q, then 1Q, 2Q, 3Q, etc.

  3. #3
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302
    Uploading your workbook would make things understandable. Place the XLS into a zipped folder and upload the folder.

  4. #4
    Registered User
    Join Date
    09-22-2007
    Posts
    4
    Here's the zip file.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302

    SumProduct used and explained

    See the attached workbook for the implementation.

    These formulas use the presence of a Week Number in Col A only for rows
    holding data, not subtotals.

    Average for the prior 13 rows
    
    =SUMPRODUCT(--(A20:A32<>0), D20:D32) / SUMPRODUCT(--(A20:A32<>0), --(D20:D32<>0))
                      A            B                      A1              B1
    Term A : 1 if there is a Week number in Col A, 0 otherwise
             Keeps other subtotals out of the sum
    Term B : All of the amounts for the 13 weeks, including 0's
    Term A1: Same form and purpose as A
    Term B1: 1 if the amount is <> 0,  0 otherwise. This counts only the non-zero
             quantities for making the average
    
    The '--' in front of the terms converts the logical value into 0 for False, 1 for 
    
    True
    
    ---
    Average for all of the rows
    
    =SUMPRODUCT(--(A$6:A32<>0), D$6:D32) / SUMPRODUCT(--(A$6:A32<>0),--(D$6:D32<>0))
    
    This is the same as the first formula, except that the start row is fixed at
    row 6 by using A$6 instead of say A6.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-22-2007
    Posts
    4
    Absolutely incredible! I have no idea how it works, but it does work. Being an excel novice, I was trying to use =Average formulas since the results I needed were averages. I obviously have a lot to learn. Thanks for taking your time to work on this. I'm blown away.

+ 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