Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11
Default counting occurances

Hello
I have a list of 13 numbers that change often. I need to find a way to keep
a running total of how many times a specific number occurs, e.g If zero
appears twice at a given time I need to add this to a specific cell, if then
zero appears nowhere it should still say 2, if zero appears once again it
should add to the total so it says 3 etc.
I tried =countif(a1:a13,"0") but as the list changes it wont keep a total.
ie if there are 4 occurances it will say 4 but if the list changes to 1, I
need the total to say 5.

Any help will be much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default counting occurances

Right click sheet tabview codecopy/paste thissave workbook
Now when you enter a number in the range the cell to the right will
increment.

Private Sub Worksheet_Change(ByVal target As Excel.Range)
If Intersect(target, Range("a1:a13")) Is Nothing _
Or IsNumeric(target) = False Then Exit Sub

Application.EnableEvents = False
target.Offset(, 1) = target.Offset(, 1) + target
Application.EnableEvents = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"neilb514" wrote in message
...
Hello
I have a list of 13 numbers that change often. I need to find a way to
keep
a running total of how many times a specific number occurs, e.g If zero
appears twice at a given time I need to add this to a specific cell, if
then
zero appears nowhere it should still say 2, if zero appears once again it
should add to the total so it says 3 etc.
I tried =countif(a1:a13,"0") but as the list changes it wont keep a total.
ie if there are 4 occurances it will say 4 but if the list changes to 1, I
need the total to say 5.

Any help will be much appreciated.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting 7 and 8 occurances [email protected] Excel Discussion (Misc queries) 2 May 9th 07 02:59 AM
Counting occurances LauriS Excel Discussion (Misc queries) 8 March 29th 07 07:34 PM
Counting Occurances Rusty Excel Discussion (Misc queries) 5 July 10th 06 08:29 PM
counting occurances SR89 Excel Worksheet Functions 6 June 28th 06 01:46 AM
Counting Date Occurances JerryBS Excel Worksheet Functions 1 March 6th 05 07:29 PM


All times are GMT +1. The time now is 03:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"