+ Reply to Thread
Results 1 to 6 of 6

Need help to write Macro code to calculate DPU with respect to associate in monthly basis

  1. #1
    Registered User
    Join Date
    04-05-2017
    Location
    Hyderabad, India
    MS-Off Ver
    2013
    Posts
    8

    Need help to write Macro code to calculate DPU with respect to associate in monthly basis

    Hello Experts, need your help to solve below issue.
    I have Work done by associates on every month and the total errors on each work item.
    I need to calculate DPU of every associate in monthly basis and plot the same in one table.

    I have attached the sample excel,
    to clarify few for an example: In sheet "Jan" There is a drawing # in Row 4, and blank from row 5 to 10, this mean Errors in column "I" is related to same part number done by associate "1".

    Now i need to calculate.
    Step 1: Count howmany drawings (Coulmn E) Associate 1 did in month Jan
    Step 2: Sum total errors (Column I) by Associate 1
    Step 3: Calculate DPU which is fraction of Total Errors / Total drawings.
    Step 4: Populate a table in sheet "DPU" to show associates in rows and month in columns (Plot DPU with respect to Associate and month)

    Note:
    Though i have mentioned only three months, we will be populating the data for whole year.

    Thanks
    Arun
    Attached Files Attached Files
    Last edited by crazyarun2004; 10-21-2017 at 02:01 PM. Reason: Changing title to meet Rule#1

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Use Macro to calculate DPU with respect to associate in monthly basis

    Try Your returned file:-
    NB:- This code Should also work for all other Months entered as per this file.
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Use Macro to calculate DPU with respect to associate in monthly basis

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    04-05-2017
    Location
    Hyderabad, India
    MS-Off Ver
    2013
    Posts
    8

    Re: Use Macro to calculate DPU with respect to associate in monthly basis

    Hope the title is fixed now, please let me know if need more changes?

    Regards
    Arun

  5. #5
    Registered User
    Join Date
    04-05-2017
    Location
    Hyderabad, India
    MS-Off Ver
    2013
    Posts
    8

    Re: Use Macro to calculate DPU with respect to associate in monthly basis

    Hello MickG, thank you for the quick turnaround.. it is working very well.
    But now i have added few columns between and the "Total Errors" column is moved to columns "AC" from column "I".
    I have tried to change this line "Num = IIf(Ray(n, col - 29) <> "", 1, 0)" to change the Ray function dimension to 29, instead of 3 in the excel you provided.
    but still i am facing errors, it says "Run-time error 9" when i referred back to check what is error, it says the data is out of region.

    Can you please help me fix this issue?

    Regards
    Arun

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Use Macro to calculate DPU with respect to associate in monthly basis

    You're welcome
    Could you please post a Basic example of your new Data & Expected Results.

    NB:- In your original file sheet, "Jan" has the Months starting in column "D", but in the other Months_sheets the months start in column "A".
    I have accommodated this in the code, but wonder if your new data still has this basic layout and whether its actually necessary.

+ 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. Use Macro to calculate DPU (Defects per unit) with respect to associate in monthly basis
    By crazyarun2004 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-19-2017, 04:43 AM
  2. Trying to create an alert on monthly basis
    By mikehk in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-06-2017, 03:04 AM
  3. Adding columns on a monthly basis
    By az015 in forum Excel General
    Replies: 4
    Last Post: 05-28-2015, 07:57 PM
  4. Vlookup and Formula needed to calculate total cost by monthly basis
    By watson853 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2013, 09:31 PM
  5. Calculate weighted average for multiple products on a monthly basis
    By arvadata in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-08-2013, 12:07 PM
  6. [SOLVED] Automate a report, which changes on a monthly basis
    By s.farrelly in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-21-2012, 01:33 PM
  7. Replies: 5
    Last Post: 08-03-2012, 01:43 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