Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Finding the row address with the specic value

Hi All,

I have spreadsheet, in which col A has dates ranging from 11-1-2005 to
12-12-2009 and the report which i run is used every monday.

Now i want to determine the last row in column A which has the date
less than or equal to the date on which i am running my report.

ex.

if i run my report on 03-12-2007, then i want to determine the last
row address in col A which has the date equal to or less than
03-12-2007. Here, date 03-12-2007 is the upper limit for the data.

Hope the problem is clear. Please help.

thanks,
navin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Finding the row address with the specic value

If the dates are in Microsoft Date/Time format (not an ascii string) the
simply use VLOOKUP. the 3rd parameter range_lookup should be FALSE. The
dates in the tabler need to be in increasing order. Sort the table to get
the dates increasing if they aren't already.

"navin" wrote:

Hi All,

I have spreadsheet, in which col A has dates ranging from 11-1-2005 to
12-12-2009 and the report which i run is used every monday.

Now i want to determine the last row in column A which has the date
less than or equal to the date on which i am running my report.

ex.

if i run my report on 03-12-2007, then i want to determine the last
row address in col A which has the date equal to or less than
03-12-2007. Here, date 03-12-2007 is the upper limit for the data.

Hope the problem is clear. Please help.

thanks,
navin


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Finding the row address with the specic value

For Vlookup as you stated, It would be the 4th parameter. the 3rd parameter
specifies what column in the lookup range to return. Also, it should be
True, not false. False says to find an exact match only.

all that said, Match is a better choice in this instance as JMay shows for a
worksheet formula.

In code

Dim res as Variant, dt as Date
Dt = Date
res = Application.Match(clng(dt),Range("A1:A500"),1)
set rng = Range("A1:A500")(res)

the column would need to be sorted ascending, but the request doesn't make
much sense if it isn't.

--
Regards,
Tom Ogilvy




"Joel" wrote:

If the dates are in Microsoft Date/Time format (not an ascii string) the
simply use VLOOKUP. the 3rd parameter range_lookup should be FALSE. The
dates in the tabler need to be in increasing order. Sort the table to get
the dates increasing if they aren't already.

"navin" wrote:

Hi All,

I have spreadsheet, in which col A has dates ranging from 11-1-2005 to
12-12-2009 and the report which i run is used every monday.

Now i want to determine the last row in column A which has the date
less than or equal to the date on which i am running my report.

ex.

if i run my report on 03-12-2007, then i want to determine the last
row address in col A which has the date equal to or less than
03-12-2007. Here, date 03-12-2007 is the upper limit for the data.

Hope the problem is clear. Please help.

thanks,
navin


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Finding the row address with the specic value

Here's a sample - Try and apply to your situation
With dates in Col A, Say in range A1:A25

In C2 enter 12/15/2006 << your report date
In D2 enter =ADDRESS(MATCH(C2,A1:A25,1),1)

HTH

"navin" wrote in message
ups.com:

Hi All,

I have spreadsheet, in which col A has dates ranging from 11-1-2005 to
12-12-2009 and the report which i run is used every monday.

Now i want to determine the last row in column A which has the date
less than or equal to the date on which i am running my report.

ex.

if i run my report on 03-12-2007, then i want to determine the last
row address in col A which has the date equal to or less than
03-12-2007. Here, date 03-12-2007 is the upper limit for the data.

Hope the problem is clear. Please help.

thanks,
navin


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
Finding Cell address by value default105 Excel Discussion (Misc queries) 2 June 30th 09 09:31 PM
Finding Cell address by value default105 Excel Discussion (Misc queries) 1 June 30th 09 11:05 AM
Finding the Address of a Cell tb Excel Worksheet Functions 5 December 13th 07 01:59 PM
Finding cell address... korcutt Excel Programming 2 November 7th 05 10:50 PM
Select specic no. of rows down Leung Excel Programming 3 September 6th 05 11:19 AM


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