+ Reply to Thread
Results 1 to 6 of 6

Trim Vlookup results

Hybrid View

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    54

    Trim Vlookup results

    Hello,

    How can I trim the result of my Vlookup?

    =SUBSTITUTE(VLOOKUP($B13,'ESR - Dowload'!$A:$W,20,FALSE),"828"," ")

    I have this formula, to change 8281B7005 into 1B7005. That works fine.

    How can I trim the "1B" and "005" off the result? I need to set the formula so that it removed the first s characters and the last 3 characters so I'm left with 7.

    I've looked at TRIM and Upper/Lower but I cant make it work.

    Thanks

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Trim Vlookup results

    Is the result of the vlookup ALWAYS a 9 digit string?
    And you basically want the 6th character ?

    You could do
    =MID(VLOOKUP(...),6,1)

  3. #3
    Registered User
    Join Date
    09-07-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Trim Vlookup results

    Quote Originally Posted by Jonmo1 View Post
    Is the result of the vlookup ALWAYS a 9 digit string?
    And you basically want the 6th character ?

    You could do
    =MID(VLOOKUP(...),6,1)


    Tried this but get an error message:

    =MID(VLOOKUP($B15,'ESR - Dowload'!$A:$W,10,FALSE), PayDaniel, 3,FALSE), 6,1)

    The lookup works by itself brings in 8281B7005


    I only want character 6 ie, "7"


  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Trim Vlookup results

    You've somehow combined 2 vlookups...??

    Quote Originally Posted by Stressed_Daniel View Post
    =MID(VLOOKUP($B15,'ESR - Dowload'!$A:$W,10,FALSE), PayDaniel, 3,FALSE), 6,1)
    Since your original vlookup is just this
    VLOOKUP($B13,'ESR - Dowload'!$A:$W,20,FALSE)
    Then it should be
    =MID(VLOOKUP($B13,'ESR - Dowload'!$A:$W,20,FALSE),6,1)

  5. #5
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Trim Vlookup results

    You would use MID - Just put the expression you need in place of my placeholder.

    MID(expression,4,7) would start and the 4th character, and return a string of 7 characters.

    Is it always going to be 4 and 7?
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,613

    Re: Trim Vlookup results

    Have you tried MID?
    Formula: copy to clipboard
    =MID(A1, 3, 1) + 0


    The +0 will convert the text value into a numeric value.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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] Trim results of splitting
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-07-2015, 05:49 AM
  2. [SOLVED] Complex ??Need to adjust formula giving unexpected results with trim & substitute
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-15-2015, 03:48 AM
  3. Replies: 3
    Last Post: 03-26-2014, 06:23 PM
  4. Vlookup and trim
    By RinkuShivnani in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-10-2012, 03:15 AM
  5. Offset 3 columns / Trim Results
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2011, 10:36 PM
  6. Trim cell results
    By Dial1 in forum Excel General
    Replies: 9
    Last Post: 07-19-2010, 07:37 PM
  7. Vlookup & Trim
    By Paperback Writer in forum Excel General
    Replies: 4
    Last Post: 02-04-2006, 03:00 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