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
Perhaps
=LOOKUP(TODAY()-1,'e1'!H:I)--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=535882To 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
quot;Brucequot; gt; wrote in message
...
gt; I have the following array that uses a date to lookup my array (i.e. in
E4).
gt; =VLOOKUP(E4,'e1'!H:I,2,1)
gt;
gt; I want to modify this so that it looksup the value less that today. For
gt; example if today is the 25th April 2006 it would return 24th April 2006.
gt;
gt; I thought of using dateadd but it would not account for weekends (or
public
gt; holidays in my data. For example the record prior to Monday 24th April
would
gt; be Friday 21st April.
gt;
gt; Any ideas?
gt;
gt; Bruce
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)
- May 27 Tue 2008 20:44
Use Vlookup to find less than today
close
全站熱搜
留言列表
發表留言