+ Reply to Thread
Results 1 to 10 of 10

Vlookup - ignore first 6 digits

  1. #1
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282

    Vlookup - ignore first 6 digits

    Hi guys, basically is there anyway that I can make this formula ignore first 6 digits of a code so the lookup will be the last 4 digits to lookup, for example 6440072282 the lookup value will basically be “2282” not sure how if incorporate that into the formula?
    Thanks.

    =IF(ISNA(VLOOKUP(C5,’CARD REGISTER’!A:C,3,0)), “”,VLOOKUP(C5,’CARD REGISTER’!A:C,3,0))

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Vlookup - ignore first 6 digits

    Try substituting C5 with RIGHT(C5,4).

    Also, I don't think that your formula will work with the quotes that you have in it.

    You want to use these "" not these “”.

  3. #3
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Yeah it was just doing that from my phone for some reason, I’ll try that tho!

  4. #4
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Doesn’t seem to work, just giving me a blank cell it’s not looking up 2282

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Vlookup - ignore first 6 digits

    Try:

    =IFERROR(VLOOKUP(--RIGHT(C5,4),'CARD REGISTER'!A:C,3,0),"")

  6. #6
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Quote Originally Posted by Phuocam View Post
    Try:

    =IFERROR(VLOOKUP(--RIGHT(C5,4),'CARD REGISTER'!A:C,3,0),"")
    Now I’m getting #NAME? Hmm..

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Vlookup - ignore first 6 digits

    Are you using an Excel version earlier than 2007? If you don't have the IFERROR function, you can use this:

    =IF(ISNA(VLOOKUP(--RIGHT(C5,4),'CARD REGISTER'!A:C,3,0)),"",VLOOKUP(--RIGHT(C5,4),'CARD REGISTER'!A:C,3,0))

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,806

    Re: Vlookup - ignore first 6 digits

    Removed by JT
    Last edited by JohnTopley; 10-03-2017 at 10:58 AM.

  9. #9
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    282
    Quote Originally Posted by 63falcondude View Post
    Are you using an Excel version earlier than 2007? If you don't have the IFERROR function, you can use this:

    =IF(ISNA(VLOOKUP(--RIGHT(C5,4),'CARD REGISTER'!A:C,3,0)),"",VLOOKUP(--RIGHT(C5,4),'CARD REGISTER'!A:C,3,0))
    Yeah I am sorry, should of mentioned.. it’s working but is there anyway to get it to be blank if there’s nothing in c5? Currently showing #VALUE?

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Vlookup - ignore first 6 digits

    Change ISNA to ISERROR.

+ 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] How to separate digits from string of numbers (must ignore characters)
    By mohit999 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2016, 03:12 PM
  2. vlookup only the right most 4 digits of the 6 digits sequential numbers
    By tabcm66 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-02-2014, 07:33 AM
  3. [SOLVED] Textbox Value to display first 3 digits but ignore any Letter or Symbol
    By Crandell in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-20-2013, 09:53 AM
  4. Formula to extract digits and VLOOKUP help
    By zloep in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2013, 01:41 PM
  5. Vlookup(ignore 0)
    By whatsmyname in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2010, 12:21 AM
  6. VLookup based with different digits
    By koklok123 in forum Excel General
    Replies: 3
    Last Post: 03-25-2010, 08:40 PM
  7. Vlookup First Two Digits
    By Cleman04 in forum Excel General
    Replies: 4
    Last Post: 03-10-2009, 12:16 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