+ Reply to Thread
Results 1 to 2 of 2

weighted average on particular date VBA code required

  1. #1
    Registered User
    Join Date
    12-08-2020
    Location
    india
    MS-Off Ver
    2019
    Posts
    2

    weighted average on particular date VBA code required

    Hii



    i have an excel sheet and iam trying to get the weighted averages for the 4 parameters based on their date, if any one can solve my question it would help to my work. i need macros code for calculating weighted average.





    upto now i did the simple average by using below code. can you modify this simple average code to weighted average code



    Range("Q" & P + 7) = Round(WorksheetFunction.AverageIf(Range("A8:A" & lastRow_R), CDate(xCol2.Item(P)), Range("E8:E" & lastRow_R)), 2)

    Range("R" & P + 7) = Round(WorksheetFunction.AverageIf(Range("A8:A" & lastRow_R), CDate(xCol2.Item(P)), Range("F8:F" & lastRow_R)), 2)

    Range("S" & P + 7) = Round(WorksheetFunction.AverageIf(Range("A8:A" & lastRow_R), CDate(xCol2.Item(P)), Range("G8:G" & lastRow_R)), 2)




    Here

    A Column indicates-Date

    E,F&G Column Indicates- Parameters

    C Column indicates -Weight for respected item

    Q,R,S Column indicates - average results to be shown here
    Attached Images Attached Images

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello kiran66,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Weighted Average by Month (or Date Range)
    By barelyliterate in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-17-2018, 05:00 AM
  2. Calculate weighted average based on a date
    By danallamas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-29-2016, 10:59 PM
  3. Calculate Weighted Average within a date range
    By danallamas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-27-2016, 10:59 AM
  4. Issue finding out weighted average for zip code list
    By itobon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-18-2015, 04:06 PM
  5. Weighted Average Rate Code
    By Nick3535 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2010, 03:42 PM
  6. custom date and time weighted average!!
    By jfzaki in forum Excel General
    Replies: 3
    Last Post: 09-24-2009, 04:01 AM
  7. Replies: 0
    Last Post: 06-09-2008, 04:29 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