+ Reply to Thread
Results 1 to 7 of 7

Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

  1. #1
    Registered User
    Join Date
    09-06-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    25

    Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Hi All,

    Attached is my Dummy Data: Review Worksheet - Dummy Data v2 0.xlsx

    My Input data is in the "Report" tab.

    And my desired output is "Unit Performance" tab.

    Currently I have employed formulas to get to the desired results.

    However, the limitation is that the input data keeps expanding both in terms of months as well as accounts. And therefore extending the formula is error prone and cumbersome.

    Can someone suggest how I can achieve this result directly via VBA?

    Guidelines as below:

    Computing Revenue --> Sum of "Total Revenue" column by Account and by Month

    Computing C&B --> Total of Sums of columns "Salary Total", "Sub con Total", "CXU Buffer cost", "CXD Buffer cost", "Group Buffer cost" divided by Revenue computed above as a percentage rounded to zero.

    Computing EBIDTA --> Sum of "EBIDTA" column by Account and by Month divided by Revenue computed above as a percentage rounded to zero.

    Quarter results are quarter totals divided by quarter revenues.

    I was trying to do this by using dictionary objects before I posted my question. But I am a VBA newbie and could not get far. Any other approaches are welcome.

    PS: Moderators, please not that I am cross posting here as I did not get any response on another forum. Link is: http://www.ozgrid.com/forum/showthread.php?t=182349
    Please alert me if I am in conflict of any forum rules and I will comply.

    Thanks.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Can't you just use a pivot table? Seems much easier

  3. #3
    Registered User
    Join Date
    09-06-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Thanks Kyle...I tried that. But was not able to replicate the result.

    For example, Travel% is a function of Overall travel cost to revenue against a unique customer in a given month.

    How can i achieve via a pivot?

    Thanks.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    You can do it with Calculated Fields in your PT:
    PHP Code: 
    Solve Order    Field    Formula
    1    C
    &B    =(ROUND(('Salary Total'+'Sub con Total'+'CXU Buffer cost'+'CXD Buffer cost'+'Group Buffer cost')/(SumRev%),0)/100)
    2    SumRev    =ROUND('Total Revenue',)
    3    Travel    =(('Visa Exp'+Foreign+Inland)/SumRev%)/100
    4    Allocated Summary    
    =(Allocated/SumRev %)/100
    5    SG
    &A    =('Total SGNA'/SumRev %)/100
    6    EBIDTA Summary    
    =(EBIDTA/SumRev %)/100 
    The variance is due to the rounding and where it occurs, have a look at the attached:
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-06-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Thanks Kyle,

    This is a great arrow to have in my quiver!

    Simple and easy to replicate.

    I will apply it to my Real data and check results.

    Cheers!

  6. #6
    Registered User
    Join Date
    09-06-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Hi Kyle,

    Is there any way to have control on grand totals?

    I ask bcos I wish to have the Quarterly numbers after every quarter rather thanhave a running total at the end. Thanks.

    Thanks.

  7. #7
    Registered User
    Join Date
    09-06-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Hi Kyle,

    Request you to let me know if this is possible(to have grand totals for every quarter, i.e after every 3 months starting April.

    Google/Forum search turned up a blank.

    Thanks.

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Metrics Calc - Migrating From Formulas to VBA....Scripting.Dictionary Perhaps?

    Yes, just group your date field by quarter

+ 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. Object - Scripting.Dictionary
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2013, 06:00 AM
  2. Scripting.Dictionary Question
    By msolari in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-27-2013, 05:39 PM
  3. [SOLVED] Scripting Dictionary
    By thisisgerald in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-18-2012, 01:30 PM
  4. [SOLVED] Scripting Dictionary help
    By williams485 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-13-2012, 08:22 AM
  5. Filter and Sort Scripting Dictionary
    By Jbryce22 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-16-2012, 03:34 PM

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