Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Find the minimum and maximum date in a list

My datasheet includes 4K plus records that each have a date associated with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Find the minimum and maximum date in a list

Say the dates (unsorted) are in column A in Sheet1. In Sheet2:

=MAX(Sheet1!A:A) for the maximum
=MIN(Sheet1!A:A) for the minimum

REMEMBER to format these cells as dates. (Excel is not smart enough to do it
by itself)
--
Gary''s Student - gsnu200814


"jeremiah" wrote:

My datasheet includes 4K plus records that each have a date associated with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Find the minimum and maximum date in a list


=MIN(Sheet1!A:A) finds lowest date in column A of Sheet1
=MAX(Sheet1!A:A) finds largest
Dates are nothing but numbers formatted in a special way
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"jeremiah" wrote in message
...
My datasheet includes 4K plus records that each have a date associated
with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest
date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Find the minimum and maximum date in a list

Have you considered using MIN and MAX to get your dates?

Barb Reinhardt

"jeremiah" wrote:

My datasheet includes 4K plus records that each have a date associated with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Find the minimum and maximum date in a list

Yes, I had considered but was looking for a macro solution. Was trying to
avoid having any formulas on the worksheet itself. The totals are being
pulled from a filtered list so I either needed to create a report template or
let a macro do it's trick and add the header to the filtered list. This will
work, just looking for alternative solutions.

"Barb Reinhardt" wrote:

Have you considered using MIN and MAX to get your dates?

Barb Reinhardt

"jeremiah" wrote:

My datasheet includes 4K plus records that each have a date associated with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Find the minimum and maximum date in a list

Sub findDates()
Dim rng As Range
Dim minMyDate As Date
Dim maxMyDate As Date

Set rng = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp))
maxMyDate = Evaluate("=MAX(" & rng.Address & ")")
minMyDate = Evaluate("=MIN(" & rng.Address & ")")

MsgBox " MIN DATE IS " & minMyDate & vbCrLf & "MAX DATE IS " &
maxMyDate
End Sub

"jeremiah" wrote:

Yes, I had considered but was looking for a macro solution. Was trying to
avoid having any formulas on the worksheet itself. The totals are being
pulled from a filtered list so I either needed to create a report template or
let a macro do it's trick and add the header to the filtered list. This will
work, just looking for alternative solutions.

"Barb Reinhardt" wrote:

Have you considered using MIN and MAX to get your dates?

Barb Reinhardt

"jeremiah" wrote:

My datasheet includes 4K plus records that each have a date associated with
them - the dates can be duplicated throughout. I am trying to create a
report to total all of those records and in the heading I need to have the
date range. So I need to search the date column and find the earliest date
and the latest date and copy just those dates to my header on my totals
worksheet. How can I find and copy those dates to a new worksheet? Have
searched and can't seem to find just the right hint.

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
Minimum and maximum date lookup Michael Peace Excel Worksheet Functions 3 October 26th 07 06:17 PM
Finding a maximum/minimum date in 2006 megacata Excel Discussion (Misc queries) 5 January 4th 07 06:43 PM
How to find the maximum from a list of variables? Chip Pearson Excel Programming 0 December 1st 06 06:25 PM
How do I find the cell reference that contains the minimum or maximum fadsnet Excel Worksheet Functions 4 September 4th 06 04:30 PM
How do I find the maximum time value from a list Lee Excel Worksheet Functions 3 June 20th 06 10:48 AM


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