+ Reply to Thread
Results 1 to 19 of 19

Combining Vlookup, TRIM and LEFT

  1. #1
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Combining Vlookup, TRIM and LEFT

    Hi,

    I have attached a workbook sample.

    Top left corner is a table (Data1):
    First Column there is data in it with spaces before it. And that's why I need TRIM function.

    In the second column I'am inserting a VLookup function to search the 1st character (LEFT Function) of column 1 inside Data 2 of column 1 and return values from the second column of data 2 table on the right hand side.

    Intended Table below is just what im trying to achieve
    Attached Files Attached Files
    Last edited by Eduards; 01-21-2019 at 11:52 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Combining Vlookup, TRIM and LEFT

    You're better of explaing what you're trying to achievethan saying "how can i combine three excel formulas" ?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,079

    Re: Combining Vlookup, TRIM and LEFT

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Re: Combining Vlookup, TRIM and LEFT

    Hi, sorry i rushed it. Edited the first post

  5. #5
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Re: Combining Vlookup, TRIM and LEFT

    Thanks Fluff13, mind if you could explain the function?

    Also, I would prefer to see left function. It makes more sense for me. Thanks
    Last edited by Eduards; 01-21-2019 at 12:02 PM.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Combining Vlookup, TRIM and LEFT

    Try this with VLOOKUP
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,079

    Re: Combining Vlookup, TRIM and LEFT

    Have a look here to learn about index match https://exceljet.net/index-and-match
    I can be done with LEFT but it then needs to ba an array formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  8. #8
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Combining Vlookup, TRIM and LEFT

    Quote Originally Posted by Eduards View Post
    I would prefer to see left function. It makes more sense for me. Thanks
    try then:

    =VLOOKUP(LEFT(TRIM(A5),1)&"*",$L$5:$M$8,2,0)
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,079

    Re: Combining Vlookup, TRIM and LEFT

    @KOKOSEK
    I think the OP to use the LEFT function on column L.

  10. #10
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Re: Combining Vlookup, TRIM and LEFT

    Quote Originally Posted by KOKOSEK View Post
    try then:

    =VLOOKUP(LEFT(TRIM(A5),1)&"*",$L$5:$M$8,2,0)
    Awesome, exactly what im looking for. Whats the "*" used for?

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,079

    Re: Combining Vlookup, TRIM and LEFT

    Quote Originally Posted by Fluff13 View Post
    @KOKOSEK
    I think the OP to use the LEFT function on column L.
    Looks like I was wrong, although I don't see the point of using LEFT on a single character

    @Eduards
    Thanks for the Rep

  12. #12
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Combining Vlookup, TRIM and LEFT

    Quote Originally Posted by Eduards View Post
    VLookup function to search the 1st character (LEFT Function) of column 1
    No, he wants to use LEFT on column 1.

    Me as well. But we all have different needs

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,079

    Re: Combining Vlookup, TRIM and LEFT

    I read it like
    to search the 1st character (LEFT Function) of column 1 inside Data 2
    Where column 1 of data2 is column L.
    But as I pointed out I was obviously wrong

  14. #14
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Re: Combining Vlookup, TRIM and LEFT

    Quote Originally Posted by Fluff13 View Post
    Looks like I was wrong, although I don't see the point of using LEFT on a single character

    @Eduards
    Thanks for the Rep
    I should of used used a better example inside the sample workbook. In reality the strings I'm using is varied length in a different workbook. But Thanks for your help

  15. #15
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Combining Vlookup, TRIM and LEFT

    OK. You welcome.

  16. #16
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Re: Combining Vlookup, TRIM and LEFT

    Quote Originally Posted by KOKOSEK View Post
    try then:

    =VLOOKUP(LEFT(TRIM(A5),1)&"*",$L$5:$M$8,2,0)
    How can this be put into a VBA code? I need it as a Macro..

    Thanks

  17. #17
    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,820

    Re: Combining Vlookup, TRIM and LEFT

    Eduardo - did you realise that you have been posting in the Excel formulas section? Shall I move this thread to the VBA section 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.

  18. #18
    Forum Contributor
    Join Date
    11-01-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    280

    Re: Combining Vlookup, TRIM and LEFT

    If you could please, thank you
    Last edited by AliGW; 01-22-2019 at 05:20 AM.

  19. #19
    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,820

    Re: Combining Vlookup, TRIM and LEFT

    Moved.

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

+ 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. VLOOKUP + TRIM, TRIM Lookup table array...
    By mangesh.mehendale in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-19-2016, 02:10 AM
  2. Trim and left formulas
    By Jack White in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-22-2013, 09:25 PM
  3. [SOLVED] Combining trim and concante formula in one cell
    By Elainefish in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-12-2013, 04:19 AM
  4. Trim Left With a Date
    By rmb623 in forum Excel General
    Replies: 1
    Last Post: 08-12-2011, 01:34 PM
  5. trim, left, right, middle
    By sarahkatt in forum Excel General
    Replies: 1
    Last Post: 03-16-2011, 02:13 PM
  6. TRIM, LEFT and other excel formula functions in VB
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2010, 10:00 AM
  7. trim left of a found word in a text variable
    By MervB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2005, 06:15 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