+ Reply to Thread
Results 1 to 1 of 1

Programmatically calculate subtotals for variable groups in Excel 2010 table

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Modesto
    MS-Off Ver
    Excel 2010
    Posts
    1

    Programmatically calculate subtotals for variable groups in Excel 2010 table

    Hi,

    I have created an Excel Table where rows and data are changing when a macro is run. In the table, there is a column which I need to show the weighted value for each level group. Please can you show me an easy way to programmatically get totals for each level without converting the table to a range. Eg based on table below, the weighted column is calculated based on the totals for each level group ie

    level, value qty weighted
    01 10 1 =sum of qty for level 01/sum of values for level 01
    01 20 5
    01 30 10
    02 20 9 =sum of qty for level 02/sum of values for level 02
    02 1 8
    03 2 6 =sum of qty for level 03/sum of values for level 03
    03 2 4
    03 100 20

    Note, the levels and their range varies from run to run. The weighted column needs to be based on a formula as the user can change the qty and values after the macro is run and the weighted column has to be recalculated. Ideally the weighted values should show only at change of group but if I have to repeat the formula, for each of the rows in the group,it is okay. Note also, I could have many of such tables in the worksheet (again generated programmatically).

    Thank you in advance.
    Last edited by cbeh26; 12-15-2012 at 01:37 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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