+ Reply to Thread
Results 1 to 12 of 12

VLOOKUP with CONCAT

  1. #1
    Registered User
    Join Date
    01-12-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    53

    Post VLOOKUP with CONCAT

    Hi, I am trying to resolve the following problem in the attached spreadsheet; Given the data in Sheet1, column B in sheet 2 needs to do the following: if value in column A of Sheet2 is found in column A of Sheet1, in column B of Sheet2, it needs to return the a concat of the data found on the specific rows of Sheet1;
    Ideally is should return only the first 5 characters, separated with a coma, just as shown in the highlighted yellow cells.
    I have been battling with this problem and have lost some sleep; your help is much appreciated.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: VLOOKUP with CONCAT

    I don't believe you can do this with a formula however it is possible with VBA.

    Code below for your interest and the file attached. Just press the button on sheet 2

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: VLOOKUP with CONCAT

    Hi

    Power Query solution

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Christopher Yap

  4. #4
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: VLOOKUP with CONCAT

    worksheet sheet2 B1 cell array formula
    HTML Code: 
    Attached Files Attached Files

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: VLOOKUP with CONCAT

    Aldenes
    I don't really consider user defined formulas (UDF's) as formula solutions - they're more VBA but if you want to go that way like wk9128 did then here's an alternative. I used wk9128 spreadsheet and added my UDF too. it is in the form of =myconcat(cell to match, first column of range to match) it assumes the range to match is always the first column and the return range is the second column so the formula will look something kike this
    Please Login or Register  to view this content.
    and then drag down.

    I put mine in column D

    UDF is

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: VLOOKUP with CONCAT

    Hi,

    if TEXTJOIN function would be available on your Excel

    =TEXTJOIN(", ",1,IF(Sheet1!$A$1:$A$10=A1,LEFT(Sheet1!$B$1:$B$10,5),""))

    Not sure if formula needs to be riconfirmed with control+shift+enter

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

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

  7. #7
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: VLOOKUP with CONCAT

    CONCAT and TEXTJOIN function , The required version is relatively high , At least OFFICE 2019 version or above
    You can consider VBA or custom functions to solve your problem

    Crooza #2 and #5 VBA & custom Define function writes very well, I have learned and collection from you , Thank you !
    bluesky63 #3 Power Query solution very well.
    Last edited by wk9128; 09-26-2020 at 02:17 AM.

  8. #8
    Registered User
    Join Date
    01-12-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    53

    Re: VLOOKUP with CONCAT

    This works great! Thank you so much!

  9. #9
    Registered User
    Join Date
    01-12-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    53

    Re: VLOOKUP with CONCAT

    Thank you! I can see it's the simplest solution, unfortunately I don't have TEXTJOIN

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: VLOOKUP with CONCAT

    UDF will be useful. Is it ok for you.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  11. #11
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,416

    Re: VLOOKUP with CONCAT

    Response #9

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved

  12. #12
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: VLOOKUP with CONCAT

    Please try with helper column
    sheet1 C1
    =IFERROR(LEFT(B1,5)&", "&VLOOKUP(A1,A2:C10,3,0),LEFT(B1,5))

    Sheet2 C1
    =VLOOKUP(A1,Sheet1!$A$1:$C$10,3,0)
    Attached Files Attached Files

+ 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] can I use CONCAT to name a table or array in a VLOOKUP formula?
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-15-2019, 01:01 PM
  2. Creating a SKU Builder: Using IFS, VLOOKUP, & CONCAT to create formulae?
    By HavenS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-19-2019, 12:19 AM
  3. Vlookup and Concat/Concatenate
    By acrete in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-14-2018, 01:38 PM
  4. [SOLVED] Combination of VLOOKUP and CONCAT
    By damobilebrood in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-13-2018, 04:14 PM
  5. Replies: 2
    Last Post: 12-01-2014, 03:25 PM
  6. difficult vlookup, 2 column conditions - no concat
    By pavlos in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-09-2013, 09:58 PM
  7. Concat Vlookup
    By Ray789 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2010, 02:15 PM

Tags for this Thread

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