+ Reply to Thread
Results 1 to 19 of 19

VLOOKUP referencing the 3rd sheet in the workbook

  1. #1
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    VLOOKUP referencing the 3rd sheet in the workbook

    I have looked for days and have not been able to find my solution.

    I am attempting to write a VLOOKUP that references a material on the current sheet (A2) and compares that to the table on the 3rd sheet. The 3rd sheet's name will change daily so I cant use a sheet name. Please help or let me know if you need any additional info. Below is the formula...that doesn't work. It tries to save sheet 3 as its own workbook.

    =VLOOKUP($A2, 'SHEET(3)'!A:G, 6, FALSE)

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Look into using INDIRECT, like putting the sheet name in a cell like B3 then something like =VLOOKUP($A2,INDIRECT(B3&"!$A2&:G1000,6,FALSE)
    untested of course.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    If the table is a structured table, then you can refer to it directly using table name.
    Like
    =VLOOKUP($A2, Table1, 6, FALSE)

  4. #4
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    I could not get the INDIRECT function to work properly. I attached a sample workbook of what I am attempting to do.

    Basically the VLOOKUP is looking for a material number from yesterday's date (which will change each day the report is run) and if that material exists, it will copy over the owner and the status.

    Hopefully that will help with my solution.

    Thanks again.
    Attached Files Attached Files
    Last edited by ExelTime; 12-04-2020 at 01:03 PM.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    No files attached. Please see yellow banner at the top of the page for instructions on how to attach a file.

  6. #6
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Yea, noticed after I posted.... file has been attached now.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    If you convert the data into a table you can use the formula in post#3
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Would the table number not change each time a table is created? How would I reference the most recent table?

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Do you always want to lookup values on the 12-3 sheet regardless of name?

  10. #10
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    No. On Monday, a new tab will be created (12-07) and I will then want to reference tab 12-4. Attached is a preview of what the sheet will look like on Monday.

    I am controlling this all with VBA and I can include my script if that will help determine the overall actions taking place and what I would like to accomplish.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Sorry but I don't understand how adding a new sheet affects the formulae in existing sheets.

  12. #12
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    I am using a macro to enter the formula into the new sheet. If I have a defined sheet in the VLOOKUP, it will not pull accurate data.

    Summary of the macro is to pull a list of materials and import it into my workbook (RAW tab). From there I create a new tab with today's date as the 2nd sheet in the workbook and paste the relative information into the new tab. I then am using the VLOPOKUP to look at the previous day's information to see if an item is repeated from the previous day and what the current status of that item is. If it does not find it on the previous tab, it leaves it blank and I know it is a new action item. Because the status changes in those cells, there is user input that will overwrite the formula on the current day. I guess, my core issue, is getting a VLOOKUP to work in the macro to always look at the 3rd sheet so I do not need to manually enter the formula each day.

    Sorry if I explained it poorly. Also, please let me know if this belongs in a different part of the forum. I do greatly appreciate your help through this.

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    This should really have been posted in the VBA/Macros section, also you should have mentioned that you were trying to insert the formula via code.
    Can you post the code you are using, when you do so please ensure that you use code tags.

  14. #14
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Please Login or Register  to view this content.

    I tried to remove the formatting, but may have missed some. Please let me know if I should start a new thread in the VBA/Macro forum. Otherwise, thank you for any help you can provide.

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Thanks for that, how about
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Good Day Fluff. This worked like a champ. I greatly appreciate your help on this matter.

    Quick follow-up if you don't mind. I am copying the same formula into column G. The difference is if it is an error (#N/A) I would like to replace that with the word NEW. I tried to put it between the VLOOKUPS, but that added it to blank spots.
    Do you happen to have a quick fix on where to add the text I want added to replace the errors?

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Try
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    12-03-2020
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    18

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    Thank you very much Fluff. Your help is very appreciated.

  19. #19
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: VLOOKUP referencing the 3rd sheet in the workbook

    You're welcome & thanks for the feedback.

+ 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. Referencing Value from other workbook range for VLOOKUP function
    By chergian in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-25-2017, 11:13 PM
  2. How to get the value from the other workbook using vlookup and cell referencing
    By krazyhype19 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2014, 06:51 AM
  3. Vlookup problem referencing another workbook
    By wattsup in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2012, 05:41 PM
  4. Replies: 1
    Last Post: 04-14-2010, 03:05 PM
  5. Vlookup and workbook sheet referencing in 2007
    By esupply in forum Excel General
    Replies: 4
    Last Post: 10-14-2009, 09:17 AM
  6. [SOLVED] VLOOKUP referencing another workbook
    By kleivakat in forum Excel General
    Replies: 2
    Last Post: 03-09-2006, 01:40 PM
  7. Referencing a sheet in VLOOKUP
    By Max in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2005, 03:25 PM

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.6.0 RC 1