+ Reply to Thread
Results 1 to 13 of 13

vlookup only the right most 4 digits of the 6 digits sequential numbers

  1. #1
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    vlookup only the right most 4 digits of the 6 digits sequential numbers

    i have the following working great, but would like to see it refine a little, as the data vlookup is 6 digits, but i only needs the last 4 digits is enough for me to work, my question is how do i go about adding that to the following function i have implemented and working fine.


    =IF(ISERROR(VLOOKUP(B4,'\\tcmfs01\home$\peter\[tracker data 4-25-14-a.xlsx]ControlSheet'!$B$2:$F$301,4,FALSE)),"",VLOOKUP(B4,'\\tcmfs01\home$\peter\[tracker data 4-25-14-a.xlsx]ControlSheet'!$B$2:$F$301,4,FALSE)

    Thanks in advance

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    Try

    =IFERROR(RIGHT(VLOOKUP(B4,'\\tcmfs01\home$\peter\[tracker data 4-25-14-a.xlsx]ControlSheet'!$B$2:$F$301,4,FALSE),4),"")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    Thank you, but no cigar, we are on the right line I think, just keep getting errors...I had the "RIGHT" after the vlookup, and that didnt work either.

  4. #4
    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,499

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    if you are doing the "right" on the B4 part I think this may work...
    =IFERROR(VLOOKUP(RIGHT(B4,4),'\\tcmfs01\home$\peter\[tracker data 4-25-14-a.xlsx]ControlSheet'!$B$2:$F$301,4,FALSE),"")
    but it is hard to tell w/o being able to test in the data.

    EDITed a little at end.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    thanks again, but still not working

  6. #6
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    is there some precedent in function, that is preventing what i am trying to do here, because of vlookup, then testing it for validity, that might limited the "right" function to perform, is this possible?

  7. #7
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    what i am trying to say, is due to the complexity of the function, perhaps there is no room for "RIGHT" function to work properly????

  8. #8
    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,499

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    Ok, I wrote this and it works, you'll have to adapt it for your needs but it shows how a vlookup and left (or right) function can work together, but you'll need to inclued "--" in it to get the left to recognize it as a number.
    =VLOOKUP(--LEFT(A101,1),$D$101:$E$105,2,FALSE)
    So i'd hope you can adapt this to your issue.

  9. #9
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    test - 6 to 4 main.xlsx

    The attached file is an example of what I trying to do, instead of inputting the 6 digits to import the data from the rest of the correspondent row, I want to be able to input the last 4 digits to do the same.

    is it possible?

  10. #10
    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,499

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    this is the only way I would see that working and I adjusted your if(iserror formulas to the more efficient iferror type, you don't need the second vlookup when using the newer formula.

    EDIT: this if iserror to iferror changed in 2007 and later versions of excel.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    Thanks buddy, i see you have created a extra column from the source to create the 4 digits identifier, but that's what i am trying to avoid, as this is only an example, my real challenge has a lot more row than that. what i am trying to do is looking up a 6 digits identifier but using last 4 digits only to match.

  12. #12
    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,499

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    Is there a reason you don't want the lookup to be based on the 6 digits? The right part will work fine for the first part of the vlookup but i'm not aware of a way to put a right into the table array part of the formula. I did get the formula more compact for you but to do the rest without using an additional column in your table array, not sure how to do that. It may take a different formula altogether.

  13. #13
    Registered User
    Join Date
    04-29-2014
    Location
    malden, ma
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: vlookup only the right most 4 digits of the 6 digits sequential numbers

    Thanks again, you are probably right about this, as the situation comes up, seems always interesting to stretch the limit of the universe.

+ 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] Looking for a formula to count single digits vs. double digits?
    By mnlaw in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-29-2023, 02:20 PM
  2. [SOLVED] How to multiply a constant to only first 10 digits of 45 digits in a Logical Function
    By gz3s36 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-10-2014, 02:40 PM
  3. Changing digits after decimal to specific digits based on a criteria
    By mpatel000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-28-2012, 02:41 AM
  4. Replies: 3
    Last Post: 12-05-2012, 11:03 PM
  5. [SOLVED] extracting digits only from column with letters and digits
    By Jayne in forum Excel General
    Replies: 11
    Last Post: 08-20-2012, 10:38 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