Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6162553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:40:26+00:00 2026-05-23T21:40:26+00:00

I am trying to use a vlookup or similar function to search a worksheet,

  • 0

I am trying to use a vlookup or similar function to search a worksheet, match account numbers, then return a specified value. My problem is there are duplicate account numbers and I would like the result to concatenate the results into one string.

Acct No   CropType
-------   ---------
0001      Grain
0001      OilSeed
0001      Hay
0002      Grain  

Is in the first worksheet, on the 2nd worksheet I have the Acct No with other information and I need to get all the matching results into one column on the 2nd worksheet ie. “Grain Oilseed Hay”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:40:28+00:00Added an answer on May 23, 2026 at 9:40 pm

    Here is a function that will do it for you. It’s a little different from Vlookup in that you will only give it the search column, not the whole range, then as the third parameter you will tell it how many columns to go left (negative numbers) or right (positive) in order to get your return value.

    I also added the option to use a seperator, in your case you will use ” “. Here is the function call for you, assuming the first row with Acct No. is A and the results is row B:

    =vlookupall("0001", A:A, 1, " ")
    

    Here is the function:

    Function VLookupAll(ByVal lookup_value As String, _
                        ByVal lookup_column As range, _
                        ByVal return_value_column As Long, _
                        Optional seperator As String = ", ") As String
    
    Dim i As Long
    Dim result As String
    
    For i = 1 To lookup_column.Rows.count
        If Len(lookup_column(i, 1).text) <> 0 Then
            If lookup_column(i, 1).text = lookup_value Then
                result = result & (lookup_column(i).offset(0, return_value_column).text & seperator)
            End If
        End If
    Next
    
    If Len(result) <> 0 Then
        result = Left(result, Len(result) - Len(seperator))
    End If
    
    VLookupAll = result
    
    End Function
    

    Notes:

    • I made “, ” the default seperator for results if you don’t enter one.
    • If there is one or more hits, I added some checking at the end to
      make sure the string doesn’t end with an extra seperator.
    • I’ve used A:A as the range since I don’t know your range, but
      obviously it’s faster if you enter the actual range.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I'm trying to use vlookup in a simple VBA function, but it is
I am trying use gem tire to search in my application. I have tables
I have been trying use the edit_post_link() function to contain an image. All of
I am trying to use a function that will allow me to import a
I'm trying use preg_match in an IF statement and return false if a string
I am trying use Thread but i have some problem (I am beginner at
I'm trying to use Vlookup to find some taxes in the Database (DB_SHEET). When
I am trying use the onClick() function in an activity for an android app.
I am trying to use VLOOKUP for the following: Column A has all my
I am trying use a regular expression in JavaScript to match instances of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.