+ Reply to Thread
Results 1 to 4 of 4

how to create a counter

  1. #1
    Registered User
    Join Date
    08-27-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    21

    how to create a counter

    I've tried googling for this, somehow I cant find much material on counters.

    I have some funds I'm working with. As an example lets say:


    Fund Name Class Value


    Bissett...............A...............$10
    Bissett...............B...............$100
    Bissett...............C...............$15
    Bissett...............D...............$20



    FT...............A...............$20
    FT...............E...............$40
    FT...............F...............$60


    I want to display the total value of a fund next to the row which has A. So Bisset, next to A, would say $145, while FT, next to A, would say $120.

    How on earth does one do this? Keep in mind this spreadsheet is hundreds of lines long so this has to be automated. Tho the fund classes keep changing, each of them has an A, so when the code detects the next line is A it says to say its a new fund.

    Thanks
    Dan

    PS - putting in spaces to make this post readable has been quite painful. I tried the indent button but that just put everything on separate lines. is there a way around this?
    Last edited by Daanish; 08-30-2010 at 07:30 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to create a counter

    Column A - Fund Name
    Column B - Class
    Column C - Value

    In D1 place this formula and copy down:

    =IF(B1="A", SUMIF(A:A, A1, C:C), "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-27-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: how to create a counter

    wow that worked, thanks!

    could you explain that for me? i can make it work by looking back and forth b/w your code and modifying mine to match it but dont actually understand the logic. google's not beign too helpful.
    Last edited by shg; 08-31-2010 at 11:58 AM. Reason: deleted spurious quote

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to create a counter

    You don't need Google. In Excel, press F1 and readup on SUMIF().

    The rest of the formula is just to make sure there is a value of "A" on the current row before it bothers to run the SUMIF() formula.

+ 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