+ Reply to Thread
Results 1 to 8 of 8

Correcting a Vlookup formula that pulls a sheet name based on data in a cell

  1. #1
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    I am trying to create this myself, and of course it's not working

    =VLOOKUP(A10,INDIRECT(F$3,"mm-dd-yy"),!$A$1:$AW$30,13,FALSE)

    my sheets in the file are named in the date format mm-dd-yy (example 07-20-14)

    F3 will contain a date such as 07/20/14, this date will change based on needs.

    Thanks for any help fixing my formula.

    Nick
    Last edited by avidcat; 07-20-2014 at 10:49 PM.

  2. #2
    Forum Guru Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    Try it like this...

    =VLOOKUP(A10,INDIRECT("'"&TEXT(F$3,"mm-dd-yy")&"'!A1:AW30"),13,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    50,749

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    You need to convert the date to text. You need to understand this about dates...a date is just a number indicating how many days have passed since 1/1/1900, so today 7/11/14 is actually 41831. excel formats it into something that we recognise as a date

    so 07-20-14 is actually just 41840

    Try =TEXT(F$3,"mm-dd-yyyy")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    Thanks Tony that worked perfect.

  5. #5
    Forum Guru Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    You're welcome. Thanks for the feedback!

  6. #6
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    Your Welcome, also Tony is it possible to use something like an =IFERROR if a sheet doesn't exist with that name it would show just a blank response or even a 0 in that cell? instead of a #REF error

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    50,749

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    Using Tony's formula...
    =IFERROR(VLOOKUP(A10,INDIRECT("'"&TEXT(F$3,"mm-dd-yy")&"'!A1:AW30"),13,0),"")

  8. #8
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Correcting a Vlookup formula that pulls a sheet name based on data in a cell

    thanks FDibbins, that worked perfect.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need formula Index and Match that pulls data from column from another sheet
    By hitecfom@gmail.com in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2014, 05:38 PM
  2. [SOLVED] Vlookup in one cell and pulls data from several columns
    By adam_crowther in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-15-2013, 05:39 AM
  3. Replies: 0
    Last Post: 09-17-2012, 11:12 AM
  4. Replies: 5
    Last Post: 01-27-2010, 05:22 PM

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