Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Earliest/Latest Date Query

I'm sure there must be a simple way of doing this ...

I have 2 columns of data:

A1:A2000 contains data of vehicles used to transport goods
B1:B2000 contains the dates on which each vehicle was used over the space of
several years

There are many duplicate entries in each column (ie; one particular vehicle
will appear many times as will any given date).

I simply need to set-up a summary that shows:

1) The total number of times each vehicle was used
2) The earliest date each vehicle was used
3) The latest date each vehicle was used

I have resolved 1) using SUMPRODUCT but can't at the moment work-out the
answer to 2) and 3). VLOOKUP comes to mind but maybe there is another
SUMPRODUCT solution?

Thanks for any help.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Earliest/Latest Date Query

Try these array formulas**:

A1:A2000 = vehicle ID
B1:B200 = dates

D1 = some vehicle ID

Earliest date:

=MIN(IF(A1:A2000=D1,B1:B2000))

Latest date:

=MAX(IF(A1:A2000=D1,B1:B2000))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have 2 columns of data:

A1:A2000 contains data of vehicles used to transport goods
B1:B2000 contains the dates on which each vehicle was used over the space
of several years

There are many duplicate entries in each column (ie; one particular
vehicle will appear many times as will any given date).

I simply need to set-up a summary that shows:

1) The total number of times each vehicle was used
2) The earliest date each vehicle was used
3) The latest date each vehicle was used

I have resolved 1) using SUMPRODUCT but can't at the moment work-out the
answer to 2) and 3). VLOOKUP comes to mind but maybe there is another
SUMPRODUCT solution?

Thanks for any help.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Earliest/Latest Date Query

I'm sure there must be a simple way of doing this ...

A pivot table is a fast n easy way

Assuming your dates are real dates in col B,
here's the steps in xl2003 to set it up:

Insert a new top row, put in labels in A1:B1, eg: Veh, Date
Select any cell within the data, click Data PivotTable ...
Click Next Next

In step 3 of the wizard, click Layout
Drag n drop Veh within the ROW area

Drag n drop Date 3 times within the DATA area
Leave the 1st one as "Count of Date"

Double click on the 2nd, select "Min" under Summarize by
Click Number Date (choose date format) OK OK

Double click on the 3rd, select "Max" under Summarize by
Click Number Date (choose date format) OK OK
Click OK Finish

Go to the pivot sheet
Drag n drop "Data" over "Total",
and you'll get the required results:
- A unique listing of vehicles in 1st col, & next to it
1) The total number of times each vehicle was used (Count of dates)
2) The earliest date each vehicle was used (Min of date)
3) The latest date each vehicle was used (Max of date)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have 2 columns of data:

A1:A2000 contains data of vehicles used to transport goods
B1:B2000 contains the dates on which each vehicle was used over the space
of several years

There are many duplicate entries in each column (ie; one particular
vehicle will appear many times as will any given date).

I simply need to set-up a summary that shows:

1) The total number of times each vehicle was used
2) The earliest date each vehicle was used
3) The latest date each vehicle was used

I have resolved 1) using SUMPRODUCT but can't at the moment work-out the
answer to 2) and 3). VLOOKUP comes to mind but maybe there is another
SUMPRODUCT solution?

Thanks for any help.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Earliest/Latest Date Query

Many thanks - I will give it a try

"T. Valko" wrote in message
...
Try these array formulas**:

A1:A2000 = vehicle ID
B1:B200 = dates

D1 = some vehicle ID

Earliest date:

=MIN(IF(A1:A2000=D1,B1:B2000))

Latest date:

=MAX(IF(A1:A2000=D1,B1:B2000))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have 2 columns of data:

A1:A2000 contains data of vehicles used to transport goods
B1:B2000 contains the dates on which each vehicle was used over the space
of several years

There are many duplicate entries in each column (ie; one particular
vehicle will appear many times as will any given date).

I simply need to set-up a summary that shows:

1) The total number of times each vehicle was used
2) The earliest date each vehicle was used
3) The latest date each vehicle was used

I have resolved 1) using SUMPRODUCT but can't at the moment work-out the
answer to 2) and 3). VLOOKUP comes to mind but maybe there is another
SUMPRODUCT solution?

Thanks for any help.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Earliest/Latest Date Query

Terry,

Your preference of course, but perhaps, just as an experiment, see whether
you get the same results using the pivot* table approach
outlined in my response

What I find that the pivot also does so easily, natively, as part of its
output, is to dredge out the all important uniques listing of vehicles (or
whatever) in the 1st col

*I'm not saying its better than the arrays that Biff suggested. It took me
longer to outline the steps than it will take for you to execute it
(it'll take a couple of seconds at the most to create the pivot)

Don't just pass up the pivot approach, give it a try, see what it can do for
you.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Earliest/Latest Date Query

You're welcome!

--
Biff
Microsoft Excel MVP


"Terry Bennett" wrote in message
...
Many thanks - I will give it a try

"T. Valko" wrote in message
...
Try these array formulas**:

A1:A2000 = vehicle ID
B1:B200 = dates

D1 = some vehicle ID

Earliest date:

=MIN(IF(A1:A2000=D1,B1:B2000))

Latest date:

=MAX(IF(A1:A2000=D1,B1:B2000))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have 2 columns of data:

A1:A2000 contains data of vehicles used to transport goods
B1:B2000 contains the dates on which each vehicle was used over the
space of several years

There are many duplicate entries in each column (ie; one particular
vehicle will appear many times as will any given date).

I simply need to set-up a summary that shows:

1) The total number of times each vehicle was used
2) The earliest date each vehicle was used
3) The latest date each vehicle was used

I have resolved 1) using SUMPRODUCT but can't at the moment work-out the
answer to 2) and 3). VLOOKUP comes to mind but maybe there is another
SUMPRODUCT solution?

Thanks for any help.







  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Earliest/Latest Date Query

You didn't give Terry the count, Biff (his item 1) <g
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Earliest/Latest Date Query

I have resolved 1) using SUMPRODUCT


--
Biff
Microsoft Excel MVP


"Max" wrote in message
...
You didn't give Terry the count, Biff (his item 1) <g
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Earliest/Latest Date Query

"T. Valko" wrote in message
...
I have resolved 1) using SUMPRODUCT


Ah, so! Looks like I had a mental block on that OP's line
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


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
Looking for the earliest/latest date in a column soconfused Excel Worksheet Functions 3 July 31st 07 08:36 PM
Calculating earliest start and latest end dates by contract Data Analyst Excel Worksheet Functions 4 June 4th 07 11:23 PM
How do I find the earliest date? Dave Shultz Excel Discussion (Misc queries) 1 May 11th 07 06:45 PM
Query Latest Date Mack Neff Excel Discussion (Misc queries) 1 April 26th 07 07:42 PM
Earliest and latest dates that can be correctly represented in Exc Kitten Excel Discussion (Misc queries) 2 April 20th 07 05:16 AM


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