Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NM NM is offline
external usenet poster
 
Posts: 51
Default Counting the changes in a cell

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting the changes in a cell

Try,

=SUMPRODUCT((A1:A100<"")*(ISNUMBER(A1:A100)/(COUNTIF(A1:A100,A1:A100&""))))

Mike

"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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Counting the changes in a cell

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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Counting the changes in a cell

Using a small Data Set of 5
10/17/08 | 10/17/08 | 10/17/08 | 10/17/08 | 10/17/08
Your formula results = 1, my formula results = 0

10/17/08 | 10/17/08 | 10/18/08 | 10/18/08 | 10/18/08
Your formula results = 2, my formula results = 1

10/17/08 | 10/17/08 | 10/18/08 | 10/18/08 | 10/17/08
Your formula results = 2, my formula results = 2

10/17/08 | 10/18/08 | 10/19/08 | 10/18/08 | 10/17/08
Your formula results = 3, my formula results = 4
--
** John C **



"Mike H" wrote:

Try,

=SUMPRODUCT((A1:A100<"")*(ISNUMBER(A1:A100)/(COUNTIF(A1:A100,A1:A100&""))))

Mike

"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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Counting the changes in a cell

Hi,

My formula does exactly what I wanted it to do. My understanding of the OP
requirement is different to yours, I'm looking for the number of unique dates.

Mike

"John C" wrote:

Using a small Data Set of 5
10/17/08 | 10/17/08 | 10/17/08 | 10/17/08 | 10/17/08
Your formula results = 1, my formula results = 0

10/17/08 | 10/17/08 | 10/18/08 | 10/18/08 | 10/18/08
Your formula results = 2, my formula results = 1

10/17/08 | 10/17/08 | 10/18/08 | 10/18/08 | 10/17/08
Your formula results = 2, my formula results = 2

10/17/08 | 10/18/08 | 10/19/08 | 10/18/08 | 10/17/08
Your formula results = 3, my formula results = 4
--
** John C **



"Mike H" wrote:

Try,

=SUMPRODUCT((A1:A100<"")*(ISNUMBER(A1:A100)/(COUNTIF(A1:A100,A1:A100&""))))

Mike

"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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Counting the changes in a cell

I did not say your formula was wrong. I was giving the OP data as it was
obvious that the OP's request is not quite clear. You interpreted the OP
wanted number of unique dates. I interpreted that the OP wanted to know how
many times the date changed. I was giving the OP as much info as possible,
as, like I said, the OP's original request is ambiguous.
--
** John C **

"Mike H" wrote:

Hi,

My formula does exactly what I wanted it to do. My understanding of the OP
requirement is different to yours, I'm looking for the number of unique dates.

Mike

"John C" wrote:

Using a small Data Set of 5
10/17/08 | 10/17/08 | 10/17/08 | 10/17/08 | 10/17/08
Your formula results = 1, my formula results = 0

10/17/08 | 10/17/08 | 10/18/08 | 10/18/08 | 10/18/08
Your formula results = 2, my formula results = 1

10/17/08 | 10/17/08 | 10/18/08 | 10/18/08 | 10/17/08
Your formula results = 2, my formula results = 2

10/17/08 | 10/18/08 | 10/19/08 | 10/18/08 | 10/17/08
Your formula results = 3, my formula results = 4
--
** John C **



"Mike H" wrote:

Try,

=SUMPRODUCT((A1:A100<"")*(ISNUMBER(A1:A100)/(COUNTIF(A1:A100,A1:A100&""))))

Mike

"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

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NM NM is offline
external usenet poster
 
Posts: 51
Default Counting the changes in a cell

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

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Counting the changes in a cell

If you are saying that you want to type a new date into a cell that has an
existing date, and then count that as a new entry, you are entering either
ground for circular calculations/iterations, or VBA territory. Either way it
is going to get tricky.

There might be a different/better way without entering into that kind of
stuff, perhaps if you detailed a little more about what you are trying to
capture.
--
** John C **

"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

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NM NM is offline
external usenet poster
 
Posts: 51
Default Counting the changes in a cell

Thanks for your reply.

I have 16 columns with dates and I want to count changes in each column
independent of another. Is it possible to do that?

Thanks!

"ShaneDevenshire" wrote:

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

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 within a cell cellcounting Excel Discussion (Misc queries) 4 October 27th 08 08:33 PM
Counting in a cell Philip Drury Excel Discussion (Misc queries) 8 July 19th 07 03:02 PM
Avoiding counting the same cell twice JRD Excel Worksheet Functions 2 September 10th 06 10:35 PM
Counting within a cell Jane Excel Worksheet Functions 2 March 31st 05 01:29 AM
Counting In a Cell carl Excel Worksheet Functions 1 November 29th 04 03:03 PM


All times are GMT +1. The time now is 05:21 AM.

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

About Us

"It's about Microsoft Excel"