Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Find row of date of previous year

Hello Group,

I have a column of dates spanning over 3 years and they are sorted to
the latest date.
I am looking for a worksheet function that will deliver the row of the
first date in the previous year.

Thanks,

Michael Singmin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Find row of date of previous year

This might work. A1;A4063 is the listing of historical dates by date
and looks for January 1st of the previous year.


=MATCH(DATE(YEAR(TODAY())-1,1,1),(A1:A4063),0)



Michael Singmin wrote:

Hello Group,

I have a column of dates spanning over 3 years and they are sorted to
the latest date.
I am looking for a worksheet function that will deliver the row of the
first date in the previous year.

Thanks,

Michael Singmin


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find row of date of previous year

=MATCH(DATE(YEAR(TODAY())-1,1,1),A1:A16,1)+ISERROR(MATCH(DATE(YEAR(TODAY())-
1,1,1),A1:A16,0))*1

Assumes the data starts in A1.

--
Regards,
Tom Ogilvy

"Michael Singmin" wrote in message
...
Hello Group,

I have a column of dates spanning over 3 years and they are sorted to
the latest date.
I am looking for a worksheet function that will deliver the row of the
first date in the previous year.

Thanks,

Michael Singmin



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find row of date of previous year

that will give an error if the first day of the year isn't in the list.

the OP didn't specify, but just to clarify.

--
Regards,
Tom Ogilvy

"scott" wrote in message
...
This might work. A1;A4063 is the listing of historical dates by date
and looks for January 1st of the previous year.


=MATCH(DATE(YEAR(TODAY())-1,1,1),(A1:A4063),0)



Michael Singmin wrote:

Hello Group,

I have a column of dates spanning over 3 years and they are sorted to
the latest date.
I am looking for a worksheet function that will deliver the row of the
first date in the previous year.

Thanks,

Michael Singmin




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Find row of date of previous year

Hello all,

Some clarification,

The dates could be
15 Sep 03
21 Jul 03
2 Mar 03
11 Nov 02
17 Jun 02

I know how do this in VBA but wondered whether one could use Match.

Thanks,

Michael Singmin
================================================== ===================

"Tom Ogilvy" wrote:

=MATCH(DATE(YEAR(TODAY())-1,1,1),A1:A16,1)+ISERROR(MATCH(DATE(YEAR(TODAY())-
1,1,1),A1:A16,0))*1

Assumes the data starts in A1.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find row of date of previous year

Sure. My formula assumed they were sorted ascending.

A slight adjustment and it returns 4 for your test data:

=MATCH(DATE(YEAR(TODAY())-1,12,31),A1:A17,-1)+ISERROR(MATCH(DATE(YEAR(TODAY(
))-1,12,31),A1:A17,0))*1
--
Regards,
Tom Ogilvy

"Michael Singmin" wrote in message
...
Hello all,

Some clarification,

The dates could be
15 Sep 03
21 Jul 03
2 Mar 03
11 Nov 02
17 Jun 02

I know how do this in VBA but wondered whether one could use Match.

Thanks,

Michael Singmin
================================================== ===================

"Tom Ogilvy" wrote:


=MATCH(DATE(YEAR(TODAY())-1,1,1),A1:A16,1)+ISERROR(MATCH(DATE(YEAR(TODAY())

-
1,1,1),A1:A16,0))*1

Assumes the data starts in A1.




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Find row of date of previous year

Thanks Tom,

Neat and instructive.

Michael

"Tom Ogilvy" wrote:

Sure. My formula assumed they were sorted ascending.

A slight adjustment and it returns 4 for your test data:

=MATCH(DATE(YEAR(TODAY())-1,12,31),A1:A17,-1)+ISERROR(MATCH(DATE(YEAR(TODAY(
))-1,12,31),A1:A17,0))*1


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
Keep a previous year when entering down a column Karlene Excel Discussion (Misc queries) 1 February 25th 10 05:30 PM
How to find the year from a given date User Excel Discussion (Misc queries) 3 December 29th 08 12:50 PM
Calulate Sales for Previous Year CaptainPugwash Excel Worksheet Functions 4 August 14th 08 01:32 PM
Use year and weeknr to find date?? ElFrodo Excel Discussion (Misc queries) 2 February 5th 07 04:19 AM
Previous year data into chart dietmarhannam Excel Discussion (Misc queries) 0 November 25th 05 01:13 PM


All times are GMT +1. The time now is 04:00 PM.

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"