A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Use Vlookup to find less than today



 
 
Thread Tools Display Modes
  #1  
Old April 25th 06, 10:44 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Use Vlookup to find less than today

I have the following array that uses a date to lookup my array (i.e. in E4).
=VLOOKUP(E4,'e1'!H:I,2,1)

I want to modify this so that it looksup the value less that today. For
example if today is the 25th April 2006 it would return 24th April 2006.

I thought of using dateadd but it would not account for weekends (or public
holidays in my data. For example the record prior to Monday 24th April would
be Friday 21st April.

Any ideas?

Bruce
Ads
  #2  
Old April 25th 06, 01:31 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Use Vlookup to find less than today


Perhaps

=LOOKUP(TODAY()-1,'e1'!H:I)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=535882

  #3  
Old April 25th 06, 03:02 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Use Vlookup to find less than today

To account for weekends, you would need to expand on daddy's formula like
this:

=IF(WEEKDAY(E4,2)=1,VLOOKUP(E4-3,'e1'!H:I,2,1),VLOOKUP(E4-1,'e1'!H:I,2,1))

--
Carlos

"Bruce" > wrote in message
...
> I have the following array that uses a date to lookup my array (i.e. in

E4).
> =VLOOKUP(E4,'e1'!H:I,2,1)
>
> I want to modify this so that it looksup the value less that today. For
> example if today is the 25th April 2006 it would return 24th April 2006.
>
> I thought of using dateadd but it would not account for weekends (or

public
> holidays in my data. For example the record prior to Monday 24th April

would
> be Friday 21st April.
>
> Any ideas?
>
> Bruce



  #4  
Old April 26th 06, 10:05 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Use Vlookup to find less than today

Holidays are a problem in Excel, you would have to create a separate
lookup table of the holidays and factor it in. To just deal with
weekends, what about
=VLOOKUP(E4-CHOOSE(WEEKDAY(E4),2,1,1,1,1,1,1),'e1'!H:I,2,1)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP Problem Ian Excel Discussion (Misc queries) 3 April 6th 06 06:47 PM
Return alternate value if VLookup can't find match SueJB Excel Worksheet Functions 7 January 5th 06 09:30 AM
Vlookup and #N/A error hrsdias Excel Worksheet Functions 6 December 27th 05 08:27 PM
How do I find the cell address of the 2nd largest of a set? Mr. Snrub Excel Discussion (Misc queries) 4 May 30th 05 12:53 PM
Have Vlookup return a Value of 0 instead of #N/A Mr Mike Excel Worksheet Functions 4 May 25th 05 04:51 PM


All times are GMT +1. The time now is 01:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.