+ Reply to Thread
Results 1 to 2 of 2

VBA Code to Insert VLOOKUP Formula in a Cell and Compute for Average

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    VBA Code to Insert VLOOKUP Formula in a Cell and Compute for Average

    Greetings!

    I have a scenario with my workbook, I am trying to insert a formula that will compute an average of specific number of cells based on the given values from the userform.

    First in the worksheet "Performance", I will open a userform by clicking the button "Find Rate" and will input data,
    The first field is the Agent no., which will become the reference for the vlookup (example is Agent2)
    Next field is I will input the starting date where the computation of the average will start, (example is 4th day)
    Then the last field is where I will input the number of days that will compute the average (example is 7days) starting from the second field (4th day)

    Scenario 1.jpg

    Second scenario is given with the Agent no. (Agent2), the cell D4 will be inserted by the formula to vlookup "Agent 2" in the other worksheet named (DAILY), and will find the 4th day and will start to get the specific cells (under column "SHFTMO", since I am looking for the average of Shift Monitoring -cell D4 sheet "Performance") 7 days from 4th day. then will compute for the average based on the given number of days to compute.

    Scenario 2.jpg

    here is the sample file.

    Agent Performance Scenario.xlsm

    hope someone could help me on this. I really appreciate your feedback regarding this.

    Thank you.
    "Consummatum Est"

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VBA Code to Insert VLOOKUP Formula in a Cell and Compute for Average

    How about rearange your data on a summary sheet?

    In that case you be able to use pivot table for analyzing the data.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ 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: 7
    Last Post: 03-15-2015, 03:12 PM
  2. Insert formula in a cell through VB code.
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2011, 04:55 PM
  3. Replies: 1
    Last Post: 11-09-2008, 10:34 PM
  4. Problem using vba code to insert a formula to certain cell
    By Juhanen II in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-14-2008, 09:09 AM
  5. [SOLVED] Code to Insert Formula in Cell
    By Paige in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2005, 12:06 PM

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