View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default Counting the changes in a cell

Hi,

That's what I thought when I read the question!

1. You can turn on Track Changes. Look this topic up in the help system for
details, it may be overkill.
2. You can write VBA code to do this

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("A1:A10"))
If Not isect Is Nothing Then
Target.Offset(0, 5) = Target.Offset(0, 5) + 1
End If
End Sub

This goes into the Worksheet object for the sheet you are working with.

This code would check everytime a change was made to the range A1:A10 and
increase the number in the cell 5 columns to the right by 1.

If this helps, please click the Yes button
--
Thanks,
Shane Devenshire


"NM" wrote:

Thanks much for your responses.
Understanding that my question was a little unclear. I want to provide some
input to clarify it.
I have 120 rows of different Projects with 16 columns of dates. In a column
I want to find out how many times date changes in a single cell.Say, A2 was
12/10/08 and it changed to 12/20, so it should be counted as one.
Similarly if A3 changes from 12/10 to 12/1, it should be counted and the
total change in the column would be 2.
Let me know if I'm still unclear.

Thanks!




"John C" wrote:

Question is a little unclear. I am interpreting your question rephrased as:
"I have a column with dates, and I want to know how many times the date
changes from row to row as I go down the column."
Assume your dates are in cells A2:A100, this formula, I believe, will give
you what you want:
=SUMPRODUCT(--($A$2:$A$99<$A$3:$A$100))
So say you had dates ranged A2:A7 as so:
10/17/08 | 10/17/08 | 10/18/08 | 10/19/08 | 10/19/08 | 10/20/08
Your result should be 3, as it changes from 10/17/08 to 10/18/08, then the
next cell to 10/19/08, and one more time to 10/20/08.
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"NM" wrote:

Hi,

I want to record/count the number of times a date changes in any cell in a
column?

I will appreciate all your help.Please let me know.

Thanks!
NM