+ Reply to Thread
Results 1 to 17 of 17

How do I create a formula to look up, match, then return a number from another column

  1. #1
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    How do I create a formula to look up, match, then return a number from another column

    I'll try to explain my problem as best I can.

    On Sheet1, I have a combined list of Tag numbers/Plate Numbers (column A), and ID number in Column B (B is empty).

    On Sheet2, Column A is Tag Number, Column B is Plate Number, and Column C is ID number (filled with ID numbers).

    I'm trying to create a formula that looks at Sheet1 column A, finds a match on Sheet2 from either Column A or B, and then returns ID Number from Column C, into the empty Column B in Sheet1.

    I'm sure this is a simple formula, but I can't wrap my brain around it.

    Thanks in advance for you help
    Last edited by RobinOfLocksley; 02-24-2017 at 01:56 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Formula Struggle

    Welcome to the forums, Robin Hood!

    Two nested IF VLOOKUPS should do the trick for you.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: Formula Struggle

    Thank you, AliGW. I knew it would be nested VLOOKUPS, but I can't seem to create the formula myself. I am hoping one of the many talented excel folks on this site and give me an example.

  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,933

    Re: Formula Struggle

    Welcome to the forum

    Try this...
    A
    B
    C
    D
    E
    F
    1
    Tag/Plate ID Tag Plate ID
    2
    aa11 ww aa
    11
    ww
    3
    bb22 xx bb
    22
    xx
    4
    cc33 yy cc
    33
    yy
    5
    dd44 zz dd
    44
    zz

    B2=INDEX($F$2:$F$5,MATCH(A2,INDEX($D$2:$D$5&$E$2:$E$5,0),0))
    copied down
    Last edited by FDibbins; 02-24-2017 at 02:04 PM.
    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

  5. #5
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: Formula Struggle

    I tried this, but my problem might be that in your example, columns D,E,F are actually A,B,C on a different sheet.

  6. #6
    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,052

    Re: How do I create a formula to look up, match, then return a number from another column

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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

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

    Re: How do I create a formula to look up, match, then return a number from another column

    Sheet1:
    A2 is TagPlate
    B2 is ID:

    =IFERROR(LOOKUP(2,1/(Sheet2!$A$2:$A$5&Sheet2!$B$2:$B$5=A2),Sheet2!$C$2:$C$5),"Not found")

    Untitled1.png
    Quang PT

  8. #8
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: How do I create a formula to look up, match, then return a number from another column

    Not sure if I uploaded correctly
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: How do I create a formula to look up, match, then return a number from another column

    Try this ...

    =IFERROR(VLOOKUP(A2,Source!$A$2:$C$7,3,0),VLOOKUP(A2,Source!$B$2:$C$7,2,0))

  10. #10
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How do I create a formula to look up, match, then return a number from another column

    try

    B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  11. #11
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: How do I create a formula to look up, match, then return a number from another column

    Dude you just changed minor items from Phuocam's formula. Do you guys look at "all" the posts? I'm not trying to be difficult, just trying to understand the way of the forumn.

  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,933

    Re: How do I create a formula to look up, match, then return a number from another column

    Have not (yet) looked at the sample file, but sometimes, all it takes to make a formula work, is to "changed minor items". There is no "way" of the forum, all members here contribute freely of their time and knowledge, and 1 of the bigger problems of written word is that 1 person understands a comment 1 way, and someone else may interpret in a completely different way. So 1 member may read your question and not be sure of what you are asking, while another member may immediately see exactly what you mean and want

  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,052

    Re: How do I create a formula to look up, match, then return a number from another column

    Also... the screen does not auto-update. So it is possble that Shukla didn't see the earlier post until after he posted. Right now, I can't open your file, so I can not tell which (if either) is correct.

    In any event, smart-alec comments are rarely appreciated here and are best avoided.

  14. #14
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: How do I create a formula to look up, match, then return a number from another column

    My apologies. I did not mean to be "smart-alecy" with my comment. It was a long frustrating day with formulas, which is not excuse. I will refrain from making comments of that type.

  15. #15
    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,052

    Re: How do I create a formula to look up, match, then return a number from another column

    No prblems. We all get bad hair days. Me more often than most....

    Did the solution (s) offered do the job for you?

  16. #16
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: How do I create a formula to look up, match, then return a number from another column

    This formula worked. Thank you so very much !!!
    Last edited by RobinOfLocksley; 02-26-2017 at 11:11 AM.

  17. #17
    Registered User
    Join Date
    02-24-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    20

    Re: How do I create a formula to look up, match, then return a number from another column

    Quote Originally Posted by Phuocam View Post
    Try this ...

    =IFERROR(VLOOKUP(A2,Source!$A$2:$C$7,3,0),VLOOKUP(A2,Source!$B$2:$C$7,2,0))
    This formula worked. Thank you so very much!!!

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. sumproduct struggle
    By shosty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2013, 03:49 PM
  3. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM
  4. Struggle to get formula to change color of cell
    By TraceyGrobbelaar in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-30-2013, 09:43 AM
  5. Simple calculated field struggle
    By one11 in forum Excel General
    Replies: 4
    Last Post: 01-18-2011, 03:49 PM
  6. GETPIVOTDATA struggle
    By EMD in forum Excel General
    Replies: 3
    Last Post: 07-09-2007, 03:59 PM
  7. Concatenation Struggle
    By Darrin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2006, 06:10 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