+ Reply to Thread
Results 1 to 11 of 11

Sumproduct formula, add up by date, average by date

  1. #1
    Forum Contributor
    Join Date
    12-30-2008
    Location
    Woking, England
    MS-Off Ver
    Excel 2007
    Posts
    197

    Sumproduct formula, add up by date, average by date

    Hi All,

    I need to tweak the attached 2016-2017 totals sheet to work out the 'total labour hours' and GC/H total' on a month by month basis. The date the formula needs to reference is Column C in current orders. ****However, I need the GC/H totals to be an average for the month, like when you select cells and excel works out the average bottom right. So for the entries in blue (current orders) so far for Feb it would be an average of £193.73****

    So in essence similar to column G (2016-2017 totals sheet) where it has the formula
    Please Login or Register  to view this content.
    I don't understand how it knows what columns to look at on the current order sheet.

    I have highlighted what I want added up on the current order sheet in blue, we have only just started filling this in so next financial year it will be filled in from the start, so will need the formula to reflect this (like the one above).

    I hope this makes sense and thank you very much for your help.

    Sam
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,279

    Re: Sumproduct formula, add up by date, average by date

    In K8

    =SUMPRODUCT(('Current Orders'!$O$2:$O$2000)*('Current Orders'!$C$2:$C$2000>=$D8)*('Current Orders'!$C$2:$C$2000<=EOMONTH($D8,0)))

    in L8

    =SUMPRODUCT(('Current Orders'!$P$2:$P$2000)*('Current Orders'!$C$2:$C$2000>=$D19)*('Current Orders'!$C$2:$C$2000<=EOMONTH($D19,0)))/SUMPRODUCT(('Current Orders'!$P$2:$P$2000>0)*('Current Orders'!$C$2:$C$2000>=$D19)*('Current Orders'!$C$2:$C$2000<=EOMONTH($D19,0)))

    Copy both down

    Results for Feb 2017
    Attached Files Attached Files
    Last edited by JohnTopley; 02-19-2017 at 07:18 AM.

  3. #3
    Forum Contributor
    Join Date
    12-30-2008
    Location
    Woking, England
    MS-Off Ver
    Excel 2007
    Posts
    197

    Re: Sumproduct formula, add up by date, average by date

    Thanks John.

    The file you have uploaded works, but when I drag them down as per the email they come up with errors. Do you know why this is not working? I have attached the issue.

    Many thannks,

    Sam
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,279

    Re: Sumproduct formula, add up by date, average by date

    Your file you sent had #DIV0 error in P2 and a spurious blank in column O which "removed" by setting O to zero except for your data (in blue).

    These cause the errors: sorry I did not mention these in my post- use file I posted as it is corrected.

  5. #5
    Forum Contributor
    Join Date
    12-30-2008
    Location
    Woking, England
    MS-Off Ver
    Excel 2007
    Posts
    197
    Quote Originally Posted by JohnTopley View Post
    Your file you sent had #DIV0 error in P2 and a spurious blank in column O which "removed" by setting O to zero except for your data (in blue).

    These cause the errors: sorry I did not mention these in my post- use file I posted as it is corrected.
    Thanks John, but I need to paste these formulas back into the original sheet as I removed some sensitive data (so can't use your one)

    Is there anything that can be added to the formula that can remove the value and div/0 errors?

    Thanks

    Sam

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,279

    Re: Sumproduct formula, add up by date, average by date

    For the #DIV0 you can add IFERROR around formula (already present in the Blue section - you did these?)
    =IFERROR(your formula,"")

    Or

    =IFERROR(your formula,0)

    For VALUE errors you could select range down to your new data (O2:O1310) and then "Clear Contents" if there is no data present (as per your posted file)

  7. #7
    Forum Contributor
    Join Date
    12-30-2008
    Location
    Woking, England
    MS-Off Ver
    Excel 2007
    Posts
    197

    Re: Sumproduct formula, add up by date, average by date

    Thanks for all your help John. It worked a treat!

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,279

    Re: Sumproduct formula, add up by date, average by date

    Thank you for the feedback and rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Forum Contributor
    Join Date
    12-30-2008
    Location
    Woking, England
    MS-Off Ver
    Excel 2007
    Posts
    197

    Re: Sumproduct formula, add up by date, average by date

    Hi all,

    I have changed this back to unsolved, as I need to change the formula in L8 (totals tab). Currently the formula gives an average of the values in column Q in the current order tab (associated to that particular month).

    Please can someone tweak the formula so that it gives an average based on the GC (column P) against labour total hours (column O). So far for March it would be £10264/58 = £176.97. It has to ignore rows 1333 and 1334 as there are no hours associated to it.

    I hope this makes sense and thanks in advance for the help.

    Regards,

    Sam
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,279

    Re: Sumproduct formula, add up by date, average by date

    In L8

    =IFERROR(SUMPRODUCT(('Current Orders'!$P$2:$P$2002)*('Current Orders'!$O$2:$O$2002>0)*('Current Orders'!$C$2:$C$2002>=$D8)*('Current Orders'!$C$2:$C$2002<=EOMONTH($D8,0)))/SUMPRODUCT(('Current Orders'!$O$2:$O$2002)*('Current Orders'!$C$2:$C$2002>=$D8)*('Current Orders'!$C$2:$C$2002<=EOMONTH($D8,0))),"")

  11. #11
    Forum Contributor
    Join Date
    12-30-2008
    Location
    Woking, England
    MS-Off Ver
    Excel 2007
    Posts
    197

    Re: Sumproduct formula, add up by date, average by date

    Hi John, Thanks ever so much. It works! All the best

    Sam

+ 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: 10
    Last Post: 12-10-2014, 08:44 PM
  2. Weighted average based on various date ranges (SUMIFS or SUMPRODUCT)?
    By MajorMattMason in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 08-14-2014, 09:34 PM
  3. [SOLVED] Using SumProduct for dates inclusive of Year to Date, Month to date, Quarter to Date
    By cartica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2014, 04:22 PM
  4. Month to Date and Quarter to Date Average from Daily data
    By asvanthi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2014, 07:10 AM
  5. [SOLVED] Need average of days for date values from date to current day that updates current date
    By FinGhost in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2013, 04:41 PM
  6. [SOLVED] Formula to find a date range and date average
    By 1Monkey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-14-2012, 11:51 AM
  7. Average Based on Date Formula
    By Peeekay in forum Excel General
    Replies: 1
    Last Post: 02-07-2012, 12:22 PM

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