Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Find Max Difference

So, hoping I can explain this tersely.

Let's say today is the 15th of January.

I have records such as the below.

Col A Col B Col C
Rep Names Event Date of Event
Bob EventA 1/1/09
Sally EventA 1/5/09
Bob EventB 1/6/09
Bob EventA 1/7/09
Sally EventA 1/12/09

I have a separate table with each rep name in column A

The report will be only for the month of January.

In column B, I want to know, for each rep, the maximum number of days
between EventA.

So, for Bob, it would be 8. This because he had an EventA on 1/7, and today
is 1/15. So, I know we need to use the DAY() function within to determine
current day of month.

For Sally, the number would be 7 since eventA was 5th and 12th.

I know the formula would have to basically figure out that, 15("today"'s day
of month)-7 = 8, 7-1 = 6 kind of thing. Seems like an array formula.

Hoping this wasn't overly complex to read... Let me know if any questions,
and thank you in advance for any attempts!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Find Max Difference

this formula:
=MAX(IF(($A$1:$A$5=E1)*($B$1:$B$5="A"),$C$1:$C$5," "))-MIN(IF(($A$1:$A
$5=E1)*($B$1:$B$5="A"),$C$1:$C$5+0,""))
(CTRL+SHIFT+ENTER)
shows 7 for Sally and 6 for Bob

did not get yr explanation re TODAY function


On 29 Gru, 18:16, Sean Timmons
wrote:
So, hoping I can explain this tersely.

Let's say today is the 15th of January.

I have records such as the below.

Col A * * * * * * * * Col B * * Col C
Rep Names * * * *Event * * Date of Event
Bob * * * * * * * * *EventA * * 1/1/09
Sally * * * * * * * * EventA * * 1/5/09
Bob * * * * * * * * *EventB * * *1/6/09
Bob * * * * * * * * *EventA * * *1/7/09
Sally * * * * * * * *EventA * * *1/12/09

I have a separate table with each rep name in column A

The report will be only for the month of January.

In column B, I want to know, for each rep, the maximum number of days
between EventA.

So, for Bob, it would be 8. This because he had an EventA on 1/7, and today
is 1/15. So, I know we need to use the DAY() function within to determine
current day of month.

For Sally, the number would be 7 since eventA was 5th and 12th.

I know the formula would have to basically figure out that, 15("today"'s day
of month)-7 = 8, 7-1 = 6 kind of thing. Seems like an array formula.

Hoping this wasn't overly complex to read... Let me know if any questions,
and thank you in advance for any attempts!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Find Max Difference

Hi,

Your title states finding the MAX difference, but your example finds the MIN
difference. Here is a formula for the MAX difference:

=MAX(($A$2:$A$6="Bob")*($D$1-$C$2:$C$6))

This is and array formula so press Shift+Ctrl+Enter to enter it.
D1 contains the date 1/15/2009.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Sean Timmons" wrote:

So, hoping I can explain this tersely.

Let's say today is the 15th of January.

I have records such as the below.

Col A Col B Col C
Rep Names Event Date of Event
Bob EventA 1/1/09
Sally EventA 1/5/09
Bob EventB 1/6/09
Bob EventA 1/7/09
Sally EventA 1/12/09

I have a separate table with each rep name in column A

The report will be only for the month of January.

In column B, I want to know, for each rep, the maximum number of days
between EventA.

So, for Bob, it would be 8. This because he had an EventA on 1/7, and today
is 1/15. So, I know we need to use the DAY() function within to determine
current day of month.

For Sally, the number would be 7 since eventA was 5th and 12th.

I know the formula would have to basically figure out that, 15("today"'s day
of month)-7 = 8, 7-1 = 6 kind of thing. Seems like an array formula.

Hoping this wasn't overly complex to read... Let me know if any questions,
and thank you in advance for any attempts!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Find Max Difference

On Dec 29, 6:53*pm, Shane Devenshire
wrote:
Hi,

Your title states finding the MAX difference, but your example finds the MIN
difference. *Here is a formula for the MAX difference:

=MAX(($A$2:$A$6="Bob")*($D$1-$C$2:$C$6))

This is and array formula so press Shift+Ctrl+Enter to enter it.
D1 contains the date 1/15/2009. *

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"Sean Timmons" wrote:
So, hoping I can explain this tersely.


Let's say today is the 15th of January.


I have records such as the below.


Col A * * * * * * * * Col B * * Col C
Rep Names * * * *Event * * Date of Event
Bob * * * * * * * * *EventA * * 1/1/09
Sally * * * * * * * * EventA * * 1/5/09
Bob * * * * * * * * *EventB * * *1/6/09
Bob * * * * * * * * *EventA * * *1/7/09
Sally * * * * * * * *EventA * * *1/12/09


I have a separate table with each rep name in column A


The report will be only for the month of January.


In column B, I want to know, for each rep, the maximum number of days
between EventA.


So, for Bob, it would be 8. This because he had an EventA on 1/7, and today
is 1/15. So, I know we need to use the DAY() function within to determine
current day of month.


For Sally, the number would be 7 since eventA was 5th and 12th.


I know the formula would have to basically figure out that, 15("today"'s day
of month)-7 = 8, 7-1 = 6 kind of thing. Seems like an array formula..


Hoping this wasn't overly complex to read... Let me know if any questions,
and thank you in advance for any attempts!- Hide quoted text -


- Show quoted text -


Presumably the max gap could also be between the start of the month
and the first occurence.

Try this formula

=MAX(FREQUENCY(ROW(INDIRECT("1:"&DAY(MIN(D1,DATE(Y EAR(C2),MONTH
(C2)+1,0)))+1))-1,IF(A2:A6="Bob",IF(B2:B6="EventA",DAY(C2:C6)))))

Where D1 is "today's" date.

This is an "array formula" that needs to be confirmed with CTRL+SHIFT
+ENTER

I assume that today must be greater than the latest date shown. The
formula also works OK if "today's" date is later than the end of the
month in question. Replace "Bob" and "EventA" with required criteria
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Find Max Difference

Hi,

" Presumably the max gap could also be between the start of the month
and the first occurrence"

In which case the current date is irrelevant

Cheers,
Shane Devenshire

"barry houdini" wrote in message
...
On Dec 29, 6:53 pm, Shane Devenshire
wrote:
Hi,

Your title states finding the MAX difference, but your example finds the
MIN
difference. Here is a formula for the MAX difference:

=MAX(($A$2:$A$6="Bob")*($D$1-$C$2:$C$6))

This is and array formula so press Shift+Ctrl+Enter to enter it.
D1 contains the date 1/15/2009.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"Sean Timmons" wrote:
So, hoping I can explain this tersely.


Let's say today is the 15th of January.


I have records such as the below.


Col A Col B Col C
Rep Names Event Date of Event
Bob EventA 1/1/09
Sally EventA 1/5/09
Bob EventB 1/6/09
Bob EventA 1/7/09
Sally EventA 1/12/09


I have a separate table with each rep name in column A


The report will be only for the month of January.


In column B, I want to know, for each rep, the maximum number of days
between EventA.


So, for Bob, it would be 8. This because he had an EventA on 1/7, and
today
is 1/15. So, I know we need to use the DAY() function within to
determine
current day of month.


For Sally, the number would be 7 since eventA was 5th and 12th.


I know the formula would have to basically figure out that,
15("today"'s day
of month)-7 = 8, 7-1 = 6 kind of thing. Seems like an array formula.


Hoping this wasn't overly complex to read... Let me know if any
questions,
and thank you in advance for any attempts!- Hide quoted text -


- Show quoted text -


Presumably the max gap could also be between the start of the month
and the first occurence.

Try this formula

=MAX(FREQUENCY(ROW(INDIRECT("1:"&DAY(MIN(D1,DATE(Y EAR(C2),MONTH
(C2)+1,0)))+1))-1,IF(A2:A6="Bob",IF(B2:B6="EventA",DAY(C2:C6)))))

Where D1 is "today's" date.

This is an "array formula" that needs to be confirmed with CTRL+SHIFT
+ENTER

I assume that today must be greater than the latest date shown. The
formula also works OK if "today's" date is later than the end of the
month in question. Replace "Bob" and "EventA" with required criteria




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Find Max Difference

Hello Shane,

I'm not sure how you come to that conclusion from my comment.

If I'm reading it correctly the current date isn't irrelevant. I'm
assuming that Sean wants to get the maximum gap between instances of
"EventA" for Bob, given a start date of 1st of the month and end date
of "today". So the maximum gap could be between actual instances (as
with Sally) or could be between the last occurence and today (as with
Bob). I also assumed that the max gap could be between the 1st of the
month and the first occurence, if that was greater than any other gap,
but I've been wrong before........

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
comparing columns to find a difference ysobored Excel Worksheet Functions 1 October 17th 08 08:03 PM
Find all possible Difference between two sets of numbers Jason Excel Worksheet Functions 1 January 24th 07 05:45 PM
Find the difference between the high & low value of a given set. Larry Excel Discussion (Misc queries) 3 January 27th 06 10:26 PM
FIND DIFFERENCE BETWEEN 50 AND <60 Sarath.Ch Excel Worksheet Functions 9 December 29th 05 01:09 AM
how do i put formula to find difference between two dates A.D New Users to Excel 3 May 12th 05 05:14 PM


All times are GMT +1. The time now is 02:18 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"