+ Reply to Thread
Results 1 to 6 of 6

Vlookup at different sheet every time

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    19

    Vlookup at different sheet every time

    Hey

    I have a situation where I need to always make a Vlookup at the last sheet instead of the same sheet as started with, when i copy my data from one sheet to antoher.

    I have tried to make an example in this file.

    ExcelForum.xlsx

    Kind regards

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Vlookup at different sheet every time

    I guess you could replace:
    Sheet1!B3
    with
    INDIRECT("'Sheet"&RIGHT(CELL("Filename"),1)-1&"'!B3")
    for example

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup at different sheet every time

    the formula doesnt make sense to me
    =IF(B3=Sheet1!B3,VLOOKUP(B3,Sheet1!B3:K31,10,FALSE),"")
    isnt that just the same as
    =IF(B3=Sheet1!B3,Sheet1!K3,"") ? or am i missing something
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    10-22-2013
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Vlookup at different sheet every time

    Martindwilson, you may be right that it is the same but that doesn't solve my problem?

    Yudlugar I can't get your formula to work. It just show up with a #VALUE! error.
    It might be because im not familiar with the INDIRECT formula.

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Vlookup at different sheet every time

    put:
    =IF(B3=Sheet1!B3,VLOOKUP(B3,INDIRECT("'Sheet"&RIGHT(CELL("Filename"),1)-1&"'!B3:K31"),10,FALSE),"")
    in sheet 3 J3 and it will look at sheet2.

    Note - it assumes your sheet names actually contain a number at the end.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup at different sheet every time

    as yudlugar says it depends on your sheet names and how many there are
    RIGHT(CELL("Filename"),1)-1 will go wrong once you reach sheet 11

+ 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 Sheet that Calculates/Tracks Staff Time-Off & Paid Time Off Accrual
    By mikecann11 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-30-2017, 02:07 PM
  2. Replies: 5
    Last Post: 04-18-2013, 11:31 AM
  3. Replies: 2
    Last Post: 03-18-2013, 10:12 PM
  4. Replies: 2
    Last Post: 03-15-2013, 08:50 PM
  5. Detailed Time Sheet (overtime, comp time, vacation used)
    By Robert D. Sandersfeld in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-22-2006, 05:25 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