Thread: Complex Count
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Bridges[_2_] Bob Bridges[_2_] is offline
external usenet poster
 
Posts: 257
Default Complex Count

Sounds easy to me. In fact, I don't think you even need a program for it;
you could do this with built-in Excel worksheet functions. Let's see he
You sort the data on number and timestamp. In a column to the right you have
this formula (assume the number is in column B and the timestamp in column A):

=IF(AND(RC2=R[-1]C2,RC1-R[-1]C1<TIME(0,2,0)),"DUP","")

This compares cols B and A to those of the previous row: If col B is the
same, and col A is less than 2 minutes later, it puts "DUP" in this cell;
otherwise it's blank. No program needed at all, so long as you sort the data
properly first.

If you WANT to write a program it can certainly be done; it would relieve
the user of sorting the data but would require him to run the program
instead. As usual, making it easier to use (by installing a button for the
user to click and writing the program) means taking more trouble yourself up
front. Which would you prefer?

--- "farid2001" wrote:
Call Date/Time Number Dialed Location Duration
09/09 22:37:36 17204355125 Denver, CO 813
09/09 22:25:24 17204355125 Denver, CO 111
09/09 22:09:09 17204355125 Denver, CO 951
09/09 22:07:08 17725710557 Sebastian, FL 57
09/09 21:03:20 13018467933 Frederick, MD 57
09/09 20:41:52 17725711815 Sebastian, FL 532
09/09 20:36:21 17725710557 Sebastian, FL 9
09/09 20:35:31 17725710557 Sebastian, FL 29
09/09 20:34:33 17725710418 Sebastian, FL 1

For example in this situation we have that 17725710557 and 17204355125 were
dialed 3 times each, but what I need is only to count as duplicate when the
same number is dialed 120 seconds or less from the time the previous call to
that number was over.