Closed Thread
Results 1 to 4 of 4

Use Vlookup to find less than today

  1. #1
    Bruce
    Guest

    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

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Perhaps

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

  3. #3
    CarlosAntenna
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    PetroffP
    Guest

    Re: 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)


Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1