+ Reply to Thread
Results 1 to 19 of 19

how to use lookup to get data by matching data in two sheets

  1. #1
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    how to use lookup to get data by matching data in two sheets

    Ref. attached TOFORUM.XLSX. There are 2 sheets Latest, BANK

    work to be done at LATEST (columns H,I,J,K), based on data from BANK.

    A formula is needed for columns H,I,J,K of sheet LATEST.

    It should match Sl.No. (A column of both sheets) and fetch data such as Account Name, Bank, Branch, Ac No into columns H,I,J,K from Sheet BANK's corresponding columns.

    Also, if there is no data available in Sheet BANK, it should leave the data without changes in Sheet Latest.

    How to do this, pls help.
    Attached Files Attached Files
    Last edited by jilaba; 02-24-2017 at 04:02 AM.
    Ask me how to hate XL.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: lookup help

    There are two things must be done:

    1) Re attach file. I could not open it.

    2) Change the title
    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    how to use lookup to get data by matching data in two sheets

    Quote Originally Posted by bebo021999 View Post
    There are two things must be done:

    1) Re attach file. I could not open it.

    2) Change the title
    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ok Thanks i will follow.
    Attached Files Attached Files
    Last edited by jilaba; 02-24-2017 at 03:57 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: lookup help

    I was able to open the sheet OK. However: your sample is MASSIVE. 10-20 rows would be much better than this.

    "Also, if there is no data available in Sheet BANK, it should leave the data without changes in Sheet Latest." You cannot have a formula and a value in the same cell. You need to rethink your requirements.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: lookup help

    Quote Originally Posted by Glenn Kennedy View Post
    I was able to open the sheet OK. However: your sample is MASSIVE. 10-20 rows would be much better than this.
    "Also, if there is no data available in Sheet BANK, it should leave the data without changes in Sheet Latest." You cannot have a formula and a value in the same cell. You need to rethink your requirements.
    Thanks, a small file is attached, also i understood "You cannot have a formula and a value in the same cell. "

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: how to use lookup to get data by matching data in two sheets

    I could not open it, or I missed something?

    Untitled.png

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: how to use lookup to get data by matching data in two sheets

    In H2, copied across and down:

    =IFERROR(VLOOKUP($A2,BANK!$A$1:$G$24,COLUMNS($A:B),FALSE),"")

    You will see that 2 has returned no results. This is because the number is stored as text. Re-enter the 2's as numbers and it works

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: lookup help

    i've just noticed that you're using excel 2003. I'll repost shortly. I'm just about to get off a bus...

  9. #9
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: how to use lookup to get data by matching data in two sheets

    Quote Originally Posted by Glenn Kennedy View Post
    In H2, copied across and down:

    =IFERROR(VLOOKUP($A2,BANK!$A$1:$G$24,COLUMNS($A:B),FALSE),"")

    You will see that 2 has returned no results. This is because the number is stored as text. Re-enter the 2's as numbers and it works
    Thanks, I will try and revert.

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: lookup help

    Quote Originally Posted by Glenn Kennedy View Post
    i've just noticed that you're using excel 2003. I'll repost shortly. I'm just about to get off a bus...
    GK, He/she is using 2013 Ver.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: how to use lookup to get data by matching data in two sheets

    Dohh!! But (s)he is using the .xls extension....

    Jilaba, do you need backwards compatability with Excel 2003??

  12. #12
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: how to use lookup to get data by matching data in two sheets

    Quote Originally Posted by Glenn Kennedy View Post
    Dohh!! But (s)he is using the .xls extension....

    Jilaba, do you need backwards compatability with Excel 2003??
    No i do not want actually, but i am habited to save all excel files in 2003, for no reason.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: how to use lookup to get data by matching data in two sheets

    I suggest that you switch. 2007+ (.xlsx) is FAR superior to 2003- (.xls). My solution should work fine in an xlsx.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 02-24-2017 at 11:40 AM.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: how to use lookup to get data by matching data in two sheets

    But re-read the comment at Post 7...

  15. #15
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: how to use lookup to get data by matching data in two sheets

    Quote Originally Posted by Glenn Kennedy View Post
    I suggest that you switch. 2007+ (.xlsx) is FAR superior to 2003- (.xls). My solution should work fine in an xlsx.
    Yes I will switch to .xlsx soon.
    Your formula is working, but i found some difficulties using that.

    1. The formula uses both A and B columns of sheet "Latest". Is it supposed to be so. Can't we use A column only?
    2. In my full workbook, i am unable to go beyond serial 25 (a column is serial). it gets no data. I attached a mid sized file as no other way to explain.
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: how to use lookup to get data by matching data in two sheets

    2. Modify the formula to read: =IFERROR(VLOOKUP($A2,BANK!$A$1:$B$240,COLUMNS($A:B),FALSE),"") That will extend the range being searched to just past the last row of data (228) on the BANK sheet.
    1. The 'COLUMNS($A:B)' part of the formula is being used as a counter. If you select LATEST!D2 and run the Evaluate Formula function from the Formula tab you'll see that it returns the number 2 which instructs VLOOKUP to look in the second column. COLUMNS($A:A) would instruct VLOOKUP to look in the first column and return the Sl. No. instead of the name.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  17. #17
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: how to use lookup to get data by matching data in two sheets

    Quote Originally Posted by JeteMc View Post
    2. Modify the formula to read: =IFERROR(VLOOKUP($A2,BANK!$A$1:$B$240,COLUMNS($A:B),FALSE),"") ...........
    thanks a lot, it worked fine.

  18. #18
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: how to use lookup to get data by matching data in two sheets

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

  19. #19
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: how to use lookup to get data by matching data in two sheets

    thanks JeteMc.

+ 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. Two Lookup and Return (Lookup the column, then lookup the row)
    By Branbran10 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2015, 04:55 PM
  2. Replies: 4
    Last Post: 05-19-2015, 08:42 PM
  3. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  4. Replies: 2
    Last Post: 05-19-2013, 08:46 AM
  5. Replies: 1
    Last Post: 11-07-2012, 01:57 PM
  6. Search lookup array to find lookup value contained within text string
    By Cookstein2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-02-2011, 09:42 AM
  7. Replies: 7
    Last Post: 06-19-2011, 12:51 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