Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default find first occurrence of data in a column

I have a column of dates (mm/dd/yyyy) in which I want to find the first
occurrence of any date in 2005. The following finds the last occurrence in
the column: LOOKUP(2005,YEAR($A$2:$A$114),$A$2:$A$114). Anyone have any
ideas how I might get the first occurrence? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default find first occurrence of data in a column

On Sun, 10 Dec 2006 04:56:00 -0800, mpierre
wrote:

I have a column of dates (mm/dd/yyyy) in which I want to find the first
occurrence of any date in 2005. The following finds the last occurrence in
the column: LOOKUP(2005,YEAR($A$2:$A$114),$A$2:$A$114). Anyone have any
ideas how I might get the first occurrence? Thanks.



The **array** formula (entered with <ctrl<shift<enter) will give the first
occurrence.

In this case, "first" means the date on the lowest numbered row in which a date
from 2005 appears. RNG cannot be a full column.

=INDEX(RNG,MATCH(TRUE,(YEAR(RNG)=2005),0))

If you want, instead, the "earliest" date in 2005 in that column, then use this
**array** formula:

=MIN(IF(YEAR(RNG)=2005,RNG))

If the dates are arranged in sorted order, ascending, the two formulas will
give the same results.


--ron
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
Find Last Occurrence of Number KimC Excel Discussion (Misc queries) 4 January 12th 09 03:24 AM
Counting the occurrence of data in one column based on two criteri Jim Prentice Excel Worksheet Functions 3 October 1st 08 06:33 AM
How to find SECOND occurrence in a string? Bill_S Excel Worksheet Functions 4 March 19th 07 06:49 PM
Find nth occurrence and replace with ":" marlea Excel Worksheet Functions 4 October 5th 05 10:43 PM
find last occurrence REMnLYN Excel Worksheet Functions 9 March 29th 05 10:43 AM


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