+ Reply to Thread
Results 1 to 3 of 3

Automate lookup formula to refer to sheet entered in a cell

  1. #1
    Registered User
    Join Date
    12-02-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Automate lookup formula to refer to sheet entered in a cell

    Here's my situation that I need help with.

    I have a file that has multiple worksheets (Apr, May for example). I currently use a lookup formula in B5 +LOOKUP(A5,APR!B2:B10,APR!A2:A10) to look at the unit code get the amount from the April worksheet. I regularly have to change the formula in B5 to use worksheets for differnent months, so I might change the Apr to May to get the correct amount. (I use the lookup formula as the units are in the column after the amounts, so the Vlookup won't work). I want to find a way to automate the formula so I can use a date field (A2) and have it find the correct information in the correct worksheet. I was thinking that I could use the text formua to identify the correct month, but I'm not sure how to integrate it into my formula. Everything I've tried so far, doesn't work. Can someone help?



    DATE
    (A2) 4/1/2011

    UNITS AMOUNT
    (A5) AR-650287 36,524.00 (B5)

    Apr
    TEXT(A2,"mmm")
    Last edited by steinfm; 05-05-2011 at 05:00 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Automate lookup formula

    Try

    =LOOKUP(A5,INDIRECT("'"&TEXT(A2,"mmm")&"'!B2:B10"),INDIRECT("'"&TEXT(A2,"mmm")&"'!A2:A10"))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-02-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Automate lookup formula to refer to sheet entered in a cell

    I tried using INDIRECT, but I think I had one too many ". Thanks for the help

+ Reply to 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