+ Reply to Thread
Results 1 to 6 of 6

Thread: Vlookup copied across to look at different sheets???

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Question Vlookup copied across to look at different sheets???

    Hi All,

    Hopefully this is just a quick one but a user has just asked me a question that i'm not sure of the solution to?

    He wants to do a Vlookup which works, not a problem.

    But he would like to copy the formula across the sheet, again not a problem, but every time it goes into the next column across he wants it to look at a different sheet??

    There is similar, but different, data on all of his 96 sheets, so when its copied across on his front master sheet, the vlookup looks at each different sheet. (And yes, he know he will have a master sheet that is at least 96 columns wide, as it will have 96, similar, but different vlookups in it!!)

    The first vlookup will look something like this (his sheets are just called 1,2,3 etc):

    =VLOOKUP($A$3,'1'!$A$3:$E$30,2,FALSE)

    The 2nd one in the column next to it will look like:

    =VLOOKUP($A$3,'2'!$A$3:$E$30,2,FALSE)

    He just doesn't want to have to change 96 vlookups manually!!

    I hope all that made sense....

    Thanks again all you genius' out there!!
    Last edited by turbofatty; 11-09-2011 at 12:18 PM. Reason: Solved

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

    Re: Vlookup copied across to look at different sheets???

    Try:

    =VLOOKUP($A$3,INDIRECT("'"&ROWS($A$3:$A3)&"'!$A$3:$E$30"),2,FALSE)

    copied down.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    10-28-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Vlookup copied across to look at different sheets???

    Hi NBVC,

    Thanks for your swift response but it didn;t work, or i have misunderstood something...

    I have attached a workbook now to probably explain the problem better.

    I have altered the vlookup MANUALLY in each one (Row 3 on Sheet1) to look at a different sheet.

    We just don't want to have to do this 96 times!!

    Thanks again...
    Attached Files Attached Files

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Vlookup copied across to look at different sheets???

    I had assumed you were copying downward, but if you are copying across columns, then try:

    =VLOOKUP($A3,INDIRECT("'"&COLUMNS($A$1:A$1)&"'!$A$3:$E$30"),2,FALSE)

    copied across and then copied down for the rest of the items in column A....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    10-28-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Vlookup copied across to look at different sheets???

    Hi NBVC,

    I have no real idea what this means but , hell yeah, it works!!!

    You are a bona-fide genius and don't let anyone tell you any different!!

    Cheers Ears

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Vlookup copied across to look at different sheets???

    FYI,

    COLUMNS() counts number of columns in the range...

    so COLUMNS($A$1:A$1) is 1. As you copy across, it becomes COLUMNS($A$1:B$1) which means 2, and so on. The $ are anchors, so that we always start at A1 and only the column letter changes as you copy across.. This is how we get the sheetnames that you have conveniently named numerically...

    But in order to reference sheetnames "indirectly" like that, we need to use the INDIRECT function and therefore INDIRECT("'"&COLUMNS($A$1:A$1)&"'!$A$3:$E$30") indirectly references the range defined by the sheetname gotten from COLUMNS() function....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0