+ Reply to Thread
Results 1 to 7 of 7

SUM/AVERAGE every nth row

  1. #1
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    SUM/AVERAGE every nth row

    On the attached, I have Mileage figures in the yellow Rows 2, 5 & 11 (note that row 8 is empty)

    I have Fuel figures in the green rows 3, 6 & 13 (note that row 9 is empty)

    I want to return an average MPG by summing all of the Mileage figures and dividing by the sum of all the Fuel figures.

    I also want to ignore any blank cells.

    Much appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: SUM/AVERAGE every nth row

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please do add reputation where you see fit, it's nice to be nice and we all enjoy a pat on the back

    Please also mark your thread as solved once it has been.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: SUM/AVERAGE every nth row

    How about >> =SUMIF(A2:A12,"Mileage*",B2:B12)/SUMIF(A2:A12,"Fuel*",B2:B12)
    HTH
    Regards, Jeff

  4. #4
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: SUM/AVERAGE every nth row

    SUMIF/SUMIFS don't seem to work. SUMIF I think is including the individual average in rows 4,7,10 & 13 so this needs to be ignored.

    SUMIFS just returns a #VALUE error.

    I want the result of the formula in Cell B1 and I want to be able to copy the formula accross multiple columns.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: SUM/AVERAGE every nth row

    Maybe you could update your example sheet and provide us with some data and what you expect as an answer.

    For me the Sumif formula works, but I don't' know what your data looks like.

  6. #6
    Forum Contributor
    Join Date
    05-29-2009
    Location
    sheffield
    MS-Off Ver
    Excel 2013
    Posts
    210

    Re: SUM/AVERAGE every nth row

    The attached now shows expected result shown ib cell B1

    I will have multiple columns so want to be able to drag the formula accross a worksheet.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: SUM/AVERAGE every nth row

    Thats the same result as Jeffrey's formula
    =SUMIF(A2:A12,"Mileage*",B2:B12)/SUMIF(A2:A12,"Fuel*",B2:B12)

    or if you are to drag it accross
    =SUMIF($A2:$A12,"Mileage*",B2:B12)/SUMIF($A2:$A12,"Fuel*",B2:B12)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 09-11-2018, 10:29 AM
  2. Replies: 2
    Last Post: 04-17-2018, 09:45 PM
  3. SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform
    By Sorjas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-18-2015, 07:40 PM
  4. [SOLVED] need formula to average cells but if one cell has N/A then dont average and input N/A
    By CityInspector in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2013, 04:16 PM
  5. [SOLVED] Find Average, Return Column Header of Number Closest To Average
    By djmyers in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-07-2013, 04:19 PM
  6. Replies: 14
    Last Post: 06-14-2013, 09:00 PM
  7. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM

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