+ Reply to Thread
Results 1 to 10 of 10

SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

  1. #1
    Registered User
    Join Date
    04-23-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Hi,

    The attached spreadsheet records dates for steps in an application process and 5 Key Performance Indicators (KPIs) which record the amount of weekdays (how long) between each step to determine any bottlenecks.

    The spreadsheet is a subset of a larger piece of data but this is the bit creating issues.


    The objective is to record the 5 KPIs as well as a running average. The 5 KPIs are split in Quarters as this is the reporting format. However the quarters are offset one month so the Financial Year starts in August not the customary July.

    1st Quarter - Aug, Sep, Oct
    2nd Quarter - Nov, Dec, Jan
    3rd Quarter - Feb, Mar, Apr
    4th Quarter - May, Jun, Jul


    The issue I have is as an application is received not all the dates are filled so the calculation I am using creates an "N/A" error until all 5 dates are completed.

    Currently I bypass this on the sheet by placing a 0.0 in the column should any date be empty but then this creates a false KPI reading as it includes the 0.0 in its quarterly calculation and adds 1 to the dividing number count thus lowering the KPI.

    Also, I am using VBA to push the data to the sheet, but also Excel formulas to determine a way to work out which quarter the row belongs to so it can be summed using the sumproduct function.

    I am sure there is a more elegant solution to capture each row, calculate the quarterly KPI just using VBA

    Eventually the This Application, Quarterly and Running Average data from the sheet will appear in the userform either automatically (ideally) or when the calculate button is pressed as each application record is cycled through.


    I appreciate any insights on how to achieve the above.

    Thank you
    Darren
    Attached Files Attached Files

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    I created a helper column to calculate the quarter.
    Enter this in M2 and fill down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In O2 enter this formula and fill across and down to row 5

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Enter this formula in O6 and fill across
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Format all results with 1 decimal place.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    04-23-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Hi newdoverman,

    Thank you for the formula snippets. I could not open the attached file (it came up as corrupted?) I have incorporated the formulas into the worksheet. I have made some changes by using dynamic ranges for the KPI column values G:K as well as column M as the rows are added from the userform input so will continue to grow.

    I continue to have the following issues:

    1. A way to automate column M so that the formula does not need to be extended when each row is added via the userform. Any way this could be automated from inside the VBA code using a Lookup or VLookup worksheet function using column L or a named range on a separate sheet (I have one hidden as "Formula")?

    2. Because the application process occurs over time, not all the dates are entered when adding the data to the worksheet using the ADD button. When leaving one or more blank dates in columns B:F the Quarterly KPI value Column relative to the date in range O:S is cleared (but not the running average figures in columns O7:S7)

    Any thoughts?

    Thanks
    Darren
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    I see nothing wrong with NDM's attached file, I opened it with no problems
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    04-23-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Thanks FDibbins,

    I have tried again on a different computer and it opened fine. I will check newdoverman's file and work off that one.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Happy to help

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Quote Originally Posted by Sorjas View Post
    2. Because the application process occurs over time, not all the dates are entered when adding the data to the worksheet using the ADD button. When leaving one or more blank dates in columns B:F the Quarterly KPI value Column relative to the date in range O:S is cleared (but not the running average figures in columns O7:S7)
    Are you saying that if a value is missing from say column G for one quarter you want O2:O5 entirely cleared even though there are valid calculations for the other quarters? I'm assuming that you only want the quarterly value to be blank for the KPI concerned.

    To eliminate the need to have the data table "automated" by VBA, why not convert it to a real table so that formulae will be copied down the worksheet as data is added. I have done this and added a formula for the ID column.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-23-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Hi ndm,

    Thank you for your patience. The quarterly KPIs in Columns range (O:S) should remain and not be cleared.

    The columns in O:S should show the current quarterly KPI. If a date is not entered in one or more columns in range (B:F) then, as a result of this, they would not populate the KPI columns (interval in days) in range(G:K). Having no figures in range (G:K), should not affect the averages in range (O:S).

    I have not been able to test the userform interaction with the worksheet you kindly modified. The calendar form is not working correctly - something to do with Monthview. I have tried importing the calendar back in but no luck; I'm using Excel 2010. When the Calendar is opened and a date selected the userform closes instead of placing the date in the textbox??

    As a result of the above, would using Excel rather than VBA to automate the worksheet calculations, work as you explain when pushing data from the userform to the worksheet? Would the necessary formulas be added to each row especially in columns L and M or will the row be added "outside" the designated range and not trigger the formulas to be copied?
    Last edited by Sorjas; 01-14-2015 at 03:34 AM.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    From your description, I think that this slightly modified version of the first file that I uploaded to you is what you want to use. I made the calendar and KP1 range into a table and in doing so had to move the range with the running totals one column to the right so that they would not be included in the table. I added a formula to column A to increment the number with each new entry. The formula in column M will be copied down as you enter data under the table. The table will automatically increase when data is added under it as long as there isn't a blank row.

    To populate the table in columns A to M VBA is needed to handle the data in the user form. I don't know VBA so can't help you there.

    This version of the file will keep a running total for the KPIs for the values that you have and not produce blanks in columns P to T.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-23-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform

    Hi Newdoverman,

    Thank you for the updated file. Unfortunatley, I have not been successful in integrating into my example worksheet. I cannot get my Userform to activate, nor the dates to be placed in the worksheet via the userform. I acknowledge your code works so it is something with my Excel program and/or code. As a result I will provide you with Rep as your solution works. Should I eventually manage to get it integrated I will update this post.

    Thanks once again
    Darren.

+ 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. [SOLVED] Average Hours Per Day - Running Total Average
    By ABAUS in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-06-2014, 03:42 PM
  2. Excel 2007 : Rolling Average on a quarterly basis
    By radiodyne in forum Excel General
    Replies: 5
    Last Post: 10-03-2011, 10:05 PM
  3. Replies: 1
    Last Post: 05-13-2009, 02:40 AM
  4. Average - How to create a running Average
    By Mihir72 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2008, 11:12 AM
  5. Error Handling #N/A with AVERAGE Function - Average of values in Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

Tags for this Thread

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