+ Reply to Thread
Results 1 to 12 of 12

How can I use VLook UP or Index to fill in data from another sheet?

  1. #1
    Registered User
    Join Date
    09-29-2013
    Location
    LA
    MS-Off Ver
    Excel 2008
    Posts
    83

    How can I use VLook UP or Index to fill in data from another sheet?

    Here is the situation.

    I am trying to fill in the blank cells in Sheet 1 which are the sold, profit cells using the data that is in sheet2.
    I would like to keep the formatting the same.
    What is the formula? Is this possible
    I provided a mock-up workbook below.

    Attachment 286035

    -Matt

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    This is what you would normally use...
    =INDEX(Sheet2!$A:$O,MATCH(Sheet1!$E4,Sheet2!$C:$C,0),MATCH(Sheet1!B$3,Sheet2!$A$3:$O$3,0))

    But from the looks of it, you actually want to pull data from the row above? If so, then use this instead...
    =INDEX(Sheet2!$A:$O,MATCH(Sheet1!$E4,Sheet2!$C:$C,0)-1,MATCH(Sheet1!B$3,Sheet2!$A$3:$O$3,0))

    Also, make sure that both sets of headings are the same, otherwise this wont work
    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

  3. #3
    Registered User
    Join Date
    09-29-2013
    Location
    LA
    MS-Off Ver
    Excel 2008
    Posts
    83

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    I copied and paste the code into the cell and I get this error #N/A
    I have no clue what I am doing wrong.
    What do you mean by "Also, make sure that both sets of headings are the same, otherwise this wont work "
    Thanks
    -Matt

    Quote Originally Posted by FDibbins View Post
    This is what you would normally use...
    =INDEX(Sheet2!$A:$O,MATCH(Sheet1!$E4,Sheet2!$C:$C,0),MATCH(Sheet1!B$3,Sheet2!$A$3:$O$3,0))

    But from the looks of it, you actually want to pull data from the row above? If so, then use this instead...
    =INDEX(Sheet2!$A:$O,MATCH(Sheet1!$E4,Sheet2!$C:$C,0)-1,MATCH(Sheet1!B$3,Sheet2!$A$3:$O$3,0))

    Also, make sure that both sets of headings are the same, otherwise this wont work

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    see the attached....
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-29-2013
    Location
    LA
    MS-Off Ver
    Excel 2008
    Posts
    83

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    Wow. That was cool. I have been watching countless youtube videos and researching on google trying to figure this out. I am still trying to learn how you did that by reading the code. Can this method be possible by adding another 2 more identical sheets to find the item number and its data?

    I upload a revised mock-up below.
    -Matt

  6. #6
    Registered User
    Join Date
    09-29-2013
    Location
    LA
    MS-Off Ver
    Excel 2008
    Posts
    83

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    Would the formula begin with an IF statement or Index Match?
    Or would I add an If statement to the Index Match formula already provided?
    Thanks

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    Is there a reason you have each month on its own sheet? It is often easier to have 1 data-base/sheet for all your data, and then run summaries and extracts from that

  8. #8
    Registered User
    Join Date
    09-29-2013
    Location
    LA
    MS-Off Ver
    Excel 2008
    Posts
    83

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    Quote Originally Posted by FDibbins View Post
    Is there a reason you have each month on its own sheet? It is often easier to have 1 data-base/sheet for all your data, and then run summaries and extracts from that
    The only reason why I have each month on its own sheet is as follows -
    - Each month is its own invoice for filing purposes
    - Each Heading contains unique data such as date sold, fees for each item, ship cost, profit
    - Also what if each invoice has over 500 items

    The main sheet is the inventory
    - Which tracks the purchase and sell date


    Wouldn't it be complicated if I had all this information on 1 sheet?
    I would have to do alot of scrolling.
    Plus I try to keep all the information on 1 page (8.5 x 11)for printing purposes to file in a Binder.

    What is your professional opinion?
    Thanks

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    Excel is designed to work with "database-type" structures, and having all the data on 1 sheet would simplify things actually, but we can work around that for what you need (it just gets a bit messy)

    See the attached. I created a helper column in I, you can hide this if you want, it just pulls in the sheet number, and will need to be added to for additional sheets.
    I then based the index/match on that helper
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-29-2013
    Location
    LA
    MS-Off Ver
    Excel 2008
    Posts
    83

    Thumbs up Re: How can I use VLook UP or Index to fill in data from another sheet?

    Quote Originally Posted by FDibbins View Post
    Excel is designed to work with "database-type" structures, and having all the data on 1 sheet would simplify things actually, but we can work around that for what you need (it just gets a bit messy)

    See the attached. I created a helper column in I, you can hide this if you want, it just pulls in the sheet number, and will need to be added to for additional sheets.
    I then based the index/match on that helper
    Wow. That is awesome. I been researching here all day trying to learn the formulas. I still dont quite understand how they work and the placement of certain functions. But, the easiest way for me to learn is to study the formulas that you provide and other users on here. I really appreciate the help.

    On the other hand, what would the formula be if I didn't want the I column. And just the whole formula put together?
    I really like the idea of the I column and I will keep it. I just want to keep studying the code and all the different methods of approach to fully understand excel.

    Thanks, MATT

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    I used a helper si that it would make it easier to add extra sheets. Plus, if you built that into the main formula, you would need to repeat what I have in the helper at least 3 times - this just leaves more room for error if you want to add extra sheets.

    The helper is a (ugly) way to test to see which sheet the reference is on. It checks teh 1st sheet, if it's not there, it checks the 2nd sheet etc. When it finds a match, it returns sheet1 or sheet2 etc. Soooo if your sheet names are not sheet1, sheet2 etc, you will need to adjust the formula acordingly

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How can I use VLook UP or Index to fill in data from another sheet?

    Happy to help and 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. [SOLVED] Create new sheet from template, auto fill from index sheet and hyperlink
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2013, 04:57 AM
  2. As user fills out data sheet, then fill out a results sheet based on data sheet entry
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-13-2012, 03:57 PM
  3. Help on VLOOK-UP - Retrieving Data from Different Sheet
    By ragavendraph in forum Excel General
    Replies: 1
    Last Post: 02-07-2012, 12:22 PM
  4. vlook/match/index
    By nowfal in forum Excel General
    Replies: 12
    Last Post: 08-30-2005, 04:05 PM
  5. [SOLVED] Vlook up or index match
    By jerry in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-24-2005, 01:06 AM

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