+ Reply to Thread
Results 1 to 28 of 28

Progressive Count

  1. #1
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Progressive Count

    It is possible to have excel to make a progressive count even if i clear the field of cells .
    For example: in cell A11 i have =COUNT(A1:A10)... for a value of (10) in A11 ... then i clear content in A1:A10 and type new values and keep a progressive total in A11.

    I have attached a workbook for reference

    Any help is greatly appreciated!!!
    Attached Files Attached Files
    Last edited by score; 05-08-2011 at 08:38 PM.

  2. #2
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Does anyone have a word for this formula?

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Progressive Count

    Quote Originally Posted by Score
    Does anyone have a word for this formula?
    "Impossible" comes to mind. Excel Functions will not remember what came before. You could use VBA to do this if you want to go that route. Macros will always need to be enabled.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi ChemistB

    What if the first count is store, let said in A12 and then every time i clear content in A1;A10 and fill again to have a progressive count, let said in A13, is this possible?

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Progressive Count

    It is possible with VBA. Are you okay with a VBA solution?

  6. #6
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    I'm new to excel and never done a VBA but i will like to give it a try. Any advantage or disadvantage with VBA

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Progressive Count

    Right click on the spreadsheet tab key and paste this code into the worksheet module
    Please Login or Register  to view this content.
    Let me know if that does what you want it to do. Disadvantages:
    1. Macros must be enabled
    2. If the person makes an error on entering, it will still add it to A11. You'll need to manually subtract it.

  8. #8
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: Progressive Count

    Here's my version:

    Please Login or Register  to view this content.
    It assumes that, per the thread title, a progressive count (not sum) is required. Errorhandling ensures that Application.EnableEvents is always set back to True.
    Last edited by Colin Legg; 05-11-2011 at 01:03 PM.
    Hope that helps,

    Colin

    RAD Excel Blog

  9. #9
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Thanks to both of you but i am struggling here. I have never made a macro before and can't get it to work, Any advice on how to make it right? i don't know what i am doing wrong...i have a mac power book & excel 2004. Just in case of any misunderstanding, I need the macro to count cells with values > 0 not to sum the values.

    Regards

  10. #10
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: Progressive Count

    Hi,

    You might want to update your profile which shows your Excel version as 2003. I know very little about Excel 2004, but I do believe that it supports VBA.

    I've attached your original workbook with the code embedded. If you change a cell within A1:A10 then the counter in A11 will increase by 1 (provided that the cell wasn't cleared). Macros must be enabled for it to work.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Progressive Count

    hi Colin,

    I'm a nosy chap & have a couple of questions about your code...
    - Why are you defining the count variable as a Double (instead of Long)?
    - ditto for using the "#" sign on the end of the 1 & the end of the 0?

    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  12. #12
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: Progressive Count

    Hi Rob,

    Some good questions there.
    Why are you defining the count variable as a Double (instead of Long)?
    When I was writing the code I knew that the count variable would end up being put on (or added to) a worksheet. All numbers on worksheets are Double data types, so I declared it as one. The code assumes that A11 contains a number (or a value which can be coerced to a number) otherwise an error will be raised.
    ditto for using the "#" sign on the end of the 1 & the end of the 0?
    As you know, # is the type declaration character for a Double data type. In the VBA IDE, if you type 1 in your code it will be read as an Integer. If you type 1# in it will be read as a Double. Since I am either adding or comparing Doubles, I used #.

    Normally I wouldn't use type declaration characters on forum posts because I think they make the code more confusing to people.
    Last edited by Colin Legg; 05-13-2011 at 04:31 AM.

  13. #13
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Colin Legg,
    Thank you very much, it does what i need but for some reason is counting 11 cells instead of 10 cell, it is possible to fix this and not to count cells that have 0? but instead of cells A1:A10 need it to count cells X9:X48 and keep the count in Y7

    Regards

  14. #14
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: Progressive Count

    Hi,

    Sure, see attached workbook.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Colin Legg

    Than you very much. It was doing exactly what i need it to do but for some reason, now that i have it integrated to the rest of the data does not want to count. It suppose to count every time i type the points on rows G16:K16 - G17:K17 and so on for each color. The only change i did is to check mark the iteration for the circular reference formula on F46:F55 and J46:J55. I have attached a workbook for reference with all the elements in place. Any advice?

    Regards.


    Regards
    Last edited by score; 06-01-2011 at 07:54 PM.

  16. #16
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Progressive Count

    Thanks Colin (re post # 12),

    I never knew that about cells containing numerical values being identified as Doubles, but I was able to support it pretty quickly via the ImmediatePane with the below statements
    Please Login or Register  to view this content.
    Score,
    I haven't looked at your circular references, but to make Colin's event code work:
    right click on the sheet tab & View Code, then change the range stated in the below line of code ("X9:X48") to whatever range you want the action to relate to.

    Please Login or Register  to view this content.
    hth
    Rob

  17. #17
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Rob, Colin

    Sorry, I do not explained clearly, (X9:X48) is the range where i need the progressive count from, but instead of typing the value on the range ( X9:X48 ) the value need to be retrieved from ( L16:L25 ), ( T16:T25 ), ( L32:L41) and ( T32:T41)

    It is possible to change the code to do that?
    Thanks

  18. #18
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Progressive Count

    hi Score,

    Sorry about the slow response.

    If you still need help with this question, can you please post the latest version of your file with the code you are currently using?
    Colin may understand from your last post, but I need more clarification, so can you please also include "before & after examples" in the file showing what you expect to see, with a brief explanation of the logic?
    If you no longer need help, can you please post your solution & mark the Thread as Solved?

    Thanks
    Rob

  19. #19
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Rob, thanks for getting back to me, yes i still need some help, that's why i have not marked Solved.
    The code Colin made did exactly what i asked him, but instead of me typing the values on the (X9:X48) range the code needs to retrieve the values from ( L16:L25 ), ( T16:T25 ), ( L32:L41) and ( T32:T41).
    For better reference I have attached the file with the code Colin made, i also copied the code on sheet 2.
    Find notes on sheet 1 on cell (Y15)

    Any help is greatly appreciated, thanks in advance
    Attached Files Attached Files

  20. #20
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Progressive Count

    hi Score,

    I'm off to sleep now, but I have asked if someone else can help out before I get back to your thread...

    Fingers crossed eh?
    Rob

  21. #21
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Progressive Count

    score,

    Give this version of the code a try:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  22. #22
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Tigeravatar

    I am new to macros, may i did not do the right thing, i opened visual basic editor and copy paste your code to replace the one i had from Colin with no luck, i don't know if i did something wrong or if the code its not doing its thing... any advice?

  23. #23
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Progressive Count

    score,

    Sorry, didn't realize those ranges were formulas, not where you enter numbers. I shoulda looked it a little longer. Here's revised code and a modified version of your workbook so you can see how it works:

    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar
    Attached Files Attached Files

  24. #24
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Tigeravatar

    I appreciate your help but that is not the result i need, the result should be 2 in cell Y7,(count cells on range X9:X48). let me try to explain it better, if you notice, on the box named yellow there is only two waves been scored (wave count), each judge gives a score (5) judges, (on L16 is the score for that 1st wave after taking the high and low and averaging the other 3 judges) the wave score given on (L16:L25),(T16:T25),(L32:L41),(T32:T41) is deleted when time is over and a new person get scores, i need those scores to show on the range X9:X48 and keep a progressive cell count of that range, the final results is the total amount of waves surfed at the end of the event (CELL R46)

  25. #25
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Progressive Count

    score,

    So the output should be to X9:X48?

  26. #26
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Yes, output from X9:X48... and the values on range X9:x18 should be retrieved from L16:L25, the values on range X19:X28 retrieved from T16:T25, the values on range X29:X38 retrieved from L32:L41, the values on range X39:X48 retrieved from T32:T41...hope this explained

  27. #27
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Progressive Count

    score,

    Updated code (see attached workbook):
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar
    Attached Files Attached Files

  28. #28
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Progressive Count

    Hi Tigeravatar
    Is not doing what i looking for, i know is possible for excel do what i need, may i have not explain well...
    here may is another way to get what i need....i need to count the range of cells with values (L16:L25),(T16:T25),(L32:L41),(T32:T41) the total count need to stay when i clear judges points and then keep a progressive count, the count could be on cell Y7

+ 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