View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default First, Last occurance of date in column

On Thu, 3 Nov 2011 10:12:18 -0700 (PDT), JumboShrimps wrote:

Have ONE column of a little more then 1,000 dates, each in a different
cell.
Column is NOT in date order, nor can it be sorted.
Need to to know the first CELL LOCATION of a date,
and then the last CELL LOCATION of a date all in ONE (same) column.
Average 100 cells between first cell location of date and last cell
location.

Thanx.


If the dates are in column A, and the date to find is in G2, then:

First Occurrence will be in row: =MATCH($G$2,$A:$A,0)
Last Occurrence will be in row: =LOOKUP(2,1/($G$2=$A:$A),ROW($A:$A))

If you need the actual address, use the ADDRESS function to give:

First Address: =ADDRESS(MATCH($G$2,$A:$A,0),1)
Last Address: =ADDRESS(LOOKUP(2,1/($G$2=$A:$A),ROW($A:$A)),1)