+ Reply to Thread
Results 1 to 5 of 5

Cumulative count

  1. #1
    Registered User
    Join Date
    01-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Cumulative count

    Hi All - just a quick query which is driving me crazy. I've attached a workbook with an abbreviated sample of what I mean (I'm sorry - the data I have is confidential, so I can't post what it actually is). What I want to do is do a cumulative count of the words that I have in column A (in my sample, letters). I just did column C manually, but in my actual document I have 500,000 rows which I want to do this to and what to produce something like column C. I don't know if they're problems, but there are repeats in column A as well as gaps where there are just spaces (they aren't actually spaces because they're formulas which have produced ""). Sorry if this is unclear and thanks for any help!

    I mean "want to produce something like column C." Sorry!
    Attached Files Attached Files
    Last edited by pike; 01-17-2012 at 05:51 AM. Reason: reset replies to zero

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Cumulative count

    if you don't need to count the number of instances in each cell, just the number of cells including your word, try this formula in cell C2 and copy down the rest of the column. Replace the "zzz" in the formula with the word you are looking for.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Cumulative count

    Thank you, but sorry, that's not quite what I'm looking for. If I want to put my numbers in column C, I want C9 to be the number of unique words in A1:A9, C10 to be the number unique words in A1:A10 etc. where the blank cells are not counted as words.

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Cumulative count

    Hi
    in that case, perhaps a user defined function will do the trick.
    This one will count all the words in a specified range (including numbers and characters so "B$55 is a cell on sheet 44" is 7 words)

    Please Login or Register  to view this content.

    Then in cell C1 enter the formula

    Please Login or Register  to view this content.
    and copy into your C column

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Cumulative count

    yours is slightly wrong as there are 10 unique in there but put in d1 =IF(COUNTIF($A$1:A1,A1)=1,1,"") drag down
    in c1 put =SUM($D$1:D1) drag down col d can be hidden or placed on another sheet altogether
    alternatively
    in c1 put 1
    in c2 put =IF(OR(A2="",COUNTIF($A$1:A2,A2)>1),c1,c1+1)
    Last edited by martindwilson; 01-17-2012 at 08:50 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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