Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Finding max value within a subgroup

Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input (the
subgroup) which finds the most recent order date (the max) and returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default Finding max value within a subgroup

Hi

With your data in A1:B9, set up a table with Customer numbers in say
D2:D4.
In cell E2 enter the following Array formula. Do not type the curly
braces { } yourself, but commit the formula with Control+Shift+Enter
and Excel will insert the curly braces for you.

{=MAX(IF($A$2:$A$9=D2,$B$2:$B$9,0))}
Copy down through E3:E4

--
Regards

Roger Govier


wrote in message
ups.com...
Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that
customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input (the
subgroup) which finds the most recent order date (the max) and returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Finding max value within a subgroup

Worked like a charm - thanks very much.

One other question - I have a third column next to the order date for
order quantity.
I'm trying to have it return the quantity purchased from the last order
I pulled using the function you gave.

Input would look like this:
Customer # Order date Quantity
1 3/5/06 2
1 4/12/06 5
1 5/19/06 4
2 1/3/06 3
2 4/5/06 4
3 2/12/06 2
3 3/19/06 1
3 5/22/06 7

Results would look like:

Customer # Most Recent Order Quantity
1 5/19/06 4
2 4/5/06 4
3 5/22/06 7

I've been trying to use INDEX(MATCH) but have not been successful,
probably because its the Friday of a long weekend.

Thanks again for everyone's help - Happy 4th.

JC



Roger Govier wrote:
Hi

With your data in A1:B9, set up a table with Customer numbers in say
D2:D4.
In cell E2 enter the following Array formula. Do not type the curly
braces { } yourself, but commit the formula with Control+Shift+Enter
and Excel will insert the curly braces for you.

{=MAX(IF($A$2:$A$9=D2,$B$2:$B$9,0))}
Copy down through E3:E4

--
Regards

Roger Govier


wrote in message
ups.com...
Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that
customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input (the
subgroup) which finds the most recent order date (the max) and returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default Finding max value within a subgroup

Hi

Try
=INDEX(A2:C9,MATCH(MAX(IF($A$2:$A$9=D2,$B$2:$B$9,0 )),B2:B9,0),3)

--
Regards

Roger Govier


wrote in message
ups.com...
Worked like a charm - thanks very much.

One other question - I have a third column next to the order date for
order quantity.
I'm trying to have it return the quantity purchased from the last
order
I pulled using the function you gave.

Input would look like this:
Customer # Order date Quantity
1 3/5/06 2
1 4/12/06 5
1 5/19/06 4
2 1/3/06 3
2 4/5/06 4
3 2/12/06 2
3 3/19/06 1
3 5/22/06 7

Results would look like:

Customer # Most Recent Order Quantity
1 5/19/06 4
2 4/5/06 4
3 5/22/06 7

I've been trying to use INDEX(MATCH) but have not been successful,
probably because its the Friday of a long weekend.

Thanks again for everyone's help - Happy 4th.

JC



Roger Govier wrote:
Hi

With your data in A1:B9, set up a table with Customer numbers in say
D2:D4.
In cell E2 enter the following Array formula. Do not type the curly
braces { } yourself, but commit the formula with
Control+Shift+Enter
and Excel will insert the curly braces for you.

{=MAX(IF($A$2:$A$9=D2,$B$2:$B$9,0))}
Copy down through E3:E4

--
Regards

Roger Govier


wrote in message
ups.com...
Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that
customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input
(the
subgroup) which finds the most recent order date (the max) and
returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default Finding max value within a subgroup

I should have said, of course, enter as an array formula with
Control+Shift+Enter to give

{=INDEX(A2:C9,MATCH(MAX(IF($A$2:$A$9=D2,$B$2:$B$9, 0)),B2:B9,0),3)}

--
Regards

Roger Govier


"Roger Govier" wrote in message
...
Hi

Try
=INDEX(A2:C9,MATCH(MAX(IF($A$2:$A$9=D2,$B$2:$B$9,0 )),B2:B9,0),3)

--
Regards

Roger Govier


wrote in message
ups.com...
Worked like a charm - thanks very much.

One other question - I have a third column next to the order date for
order quantity.
I'm trying to have it return the quantity purchased from the last
order
I pulled using the function you gave.

Input would look like this:
Customer # Order date Quantity
1 3/5/06 2
1 4/12/06 5
1 5/19/06 4
2 1/3/06 3
2 4/5/06 4
3 2/12/06 2
3 3/19/06 1
3 5/22/06 7

Results would look like:

Customer # Most Recent Order Quantity
1 5/19/06 4
2 4/5/06 4
3 5/22/06 7

I've been trying to use INDEX(MATCH) but have not been successful,
probably because its the Friday of a long weekend.

Thanks again for everyone's help - Happy 4th.

JC



Roger Govier wrote:
Hi

With your data in A1:B9, set up a table with Customer numbers in say
D2:D4.
In cell E2 enter the following Array formula. Do not type the curly
braces { } yourself, but commit the formula with
Control+Shift+Enter
and Excel will insert the curly braces for you.

{=MAX(IF($A$2:$A$9=D2,$B$2:$B$9,0))}
Copy down through E3:E4

--
Regards

Roger Govier


wrote in message
ups.com...
Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that
customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input
(the
subgroup) which finds the most recent order date (the max) and
returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Finding max value within a subgroup

Hi!

Assume the raw data is in the range A2:B9

In G2 on down you have the unique customer #'s:

G1 = 1
G2 = 2
G3 = 3
etc

Enter this formula in H2:

=SUMPRODUCT(MAX((A$2:A$9=G2)*(B$2:B$9)))

Copy down as needed and format the cells as DATE.

Biff

wrote in message
ups.com...
Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input (the
subgroup) which finds the most recent order date (the max) and returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Finding max value within a subgroup

I'm having one of those days..........argh!

In G2 on down you have the unique customer #'s:
G1 = 1
G2 = 2
G3 = 3
etc


Obviously, that should look like this:

G2 = 1
G3 = 2
G4 = 3
etc

Biff

"Biff" wrote in message
...
Hi!

Assume the raw data is in the range A2:B9

In G2 on down you have the unique customer #'s:

G1 = 1
G2 = 2
G3 = 3
etc

Enter this formula in H2:

=SUMPRODUCT(MAX((A$2:A$9=G2)*(B$2:B$9)))

Copy down as needed and format the cells as DATE.

Biff

wrote in message
ups.com...
Here's what I'm looking at:

I've got a data set which pairs a customer with the dates that customer
has ordered, looking like this:

Customer # Order date
1 3/5/06
1 4/12/06
1 5/19/06
2 1/3/06
2 4/5/06
3 2/12/06
3 3/19/06
3 5/22/06

And so forth. Its a very long list.
I need to write a function with the customer number as an input (the
subgroup) which finds the most recent order date (the max) and returns
that date, so the output would look like this:

Customer # Most Recent Order
1 5/19/06
2 4/5/06
3 5/22/06

Thanks in advance for your help,

JC





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
Finding Asymptotes from a set of data in Excel WAYNEL Excel Worksheet Functions 1 January 7th 06 01:28 AM
Finding Asymptotes from a set of data in Excel WAYNEL Excel Discussion (Misc queries) 0 January 6th 06 10:48 PM
Finding the maximum of a subset of values on a different sheet rmellison Excel Discussion (Misc queries) 4 December 1st 05 03:56 PM
Finding text within text Teresa Robinson New Users to Excel 8 October 20th 05 10:20 PM
Finding Duplicate Names from Different Lists... PokerZan Excel Discussion (Misc queries) 1 July 8th 05 09:58 AM


All times are GMT +1. The time now is 12:52 PM.

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"