1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help Needed: Write an Excel Macro

Discussion in 'Software Development' started by mine75, Oct 10, 2008.

Thread Status:
Not open for further replies.
  1. mine75

    mine75 Thread Starter

    Joined:
    Oct 10, 2008
    Messages:
    1
    Hi, all excel expert! I need help in writing a macro to do a sum in excel (which has 1milion lines of data).
    I am trying to do a cumsum column where it will cum previous roll value in the Value column if the Object_Type matches to it’s previous, IF not it will print the value at Value colume. See the table below at row 8, where the cumsum value is the Value in column B, bc of mismate of A(8) to A(7). Anyone knows how to write this? See example below. Thanks.

    =IF(A2=A1,SUM(B2,C1),B2) รจ formula in excel (I can’t do this with 2million lines of data in excel)

    I know how to do it for hundreds line data, but the dataset that's 1million lines.. :(
    Please help...

    ColA ColB ColC
    ObjectType Value CumSum
    A 1 1
    A 2 3
    A 2 5
    A 1 6
    A 0 6
    A 5 11
    Z 3 3
    Z 2 5
    Z 0 5
    Z 1 6
    Z 4 10
    Q 2 2
    Q 0 2
    Q 0 2
    W 1 1
    W 1 2
    W 3 5
    W 4 9
     
  2. HCD

    HCD

    Joined:
    Oct 29, 2007
    Messages:
    495
    Not sure on limitations within macros - but have you tried running "cumulative" macros. Take selection of macros to "cumsum" say 100,000 lines and then run a final macro to take all of the 100,000 calculations. Presumably the numbers are all fixed, whole numbers with no decimal places....?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/757823

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice