+ Reply to Thread
Results 1 to 2 of 2

Conditon based calculation in excel using VB script/Macro

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    1

    Conditon based calculation in excel using VB script/Macro

    Hello All,

    Please help me with this.
    I have a specific requirement which is as below.
    There are three columns in excel. Employee No, Sales count and Cumulative %.

    [Employee No.] [Sales count] [ Cumulative %]
    [ 1 ] [ 10 ] [Logic : (10/sum of coulumn Sales count)*100 ]
    [ 2 ] [ 9 ] [Logic : ((10+9)/sum of column sales count)*100]
    [ 3 ] [ 6 ] [Logic : ((6+9+10)/sum of coulumn sales count)*100]
    [ 4 ] [ 4 ] [Logic : ((4+6+9+10)/sum of coulumn sales count)*100]
    [ 5 ] [ 5 ] [Logic : ((5+4+6+9+10)/sum of coulumn sales count)*100]
    [ . ] [ . ] [ . ]
    [ . ] [ . ] [... ]
    [ . ] [ . ] [ ............... ]
    I want to calculate values for cumulative %. The logic is the one given in above sample data. Please have a look at the attachmnet if data given above is not clear.
    The problem here is I cannot write direct formula because Employee No. and sales count is not fixed. It can grow up to any limit. So can any one tell me that how to fill the cumulative % coulmn by using a Excel VB script and stop the calcullation once it is done for all Employee numbers present in first coulmn.
    Many Thanks,
    Sreeja
    Attached Images Attached Images

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,957

    Re: Conditon based calculation in excel using VB script/Macro

    Hi and welcome to the forum

    Please do not upload a picture of your file...rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome is (manually entered is ok) and how you arrived at that. (exclude sensitive info). Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you Also, not all members can upload picture files (Company firewalls and stuff)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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: 11
    Last Post: 10-30-2013, 05:04 AM
  2. Bundle Lookup with Calculation & Script
    By pr4t3ek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2012, 11:21 PM
  3. Excel VB Script to Enter Data based on whether a Cell is empty or not
    By timepass111 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2011, 10:27 AM
  4. vba script to generate files based on an data from an Excel sheet
    By bananas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-30-2007, 03:00 PM
  5. [SOLVED] Excel Macro or other script
    By MartinaL in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-06-2005, 09:05 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