+ Reply to Thread
Results 1 to 4 of 4

Lookup multiple values concatenated into one cell without duplicates

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    21

    Lookup multiple values concatenated into one cell without duplicates

    Hi,

    I have a excel dump of employees with more than half a million rows. I need to lookup this data and return multiple values concatenated into one cell without duplicates. I found out an udf which is working well, but the problem is with such a huge data to lookup and dragging this formula to around thousand rows makes the file very heavy and the file stops responding at times for as long as four hours, coz it takes humongous time to execute the code. The udf that I used was:

    Function MLOOKUP(lVal, Rng As Range, lVal_Col_Index As Long, Rslt_Col_Index As Long, Optional tFlag As Boolean) As String
    Dim a, x, s, i As Long
    a = Rng
    With CreateObject("scripting.dictionary")
    .comparemode = vbTextCompare
    For i = 1 To UBound(a, 1)
    If UCase(a(i, lVal_Col_Index)) = UCase(lVal) Then
    Select Case tFlag
    Case True
    s = Format(a(i, Rslt_Col_Index), "hh:mm")
    If Not .exists(s) Then .Add s, Nothing
    Case Else
    s = a(i, Rslt_Col_Index)
    If Not .exists(s) Then .Add s, Nothing
    End Select
    End If
    Next
    If .Count > 0 Then
    MLOOKUP = Join(.Keys, ";")
    End If
    End With
    End Function

    Please help with something that works fast.

  2. #2
    Forum Contributor
    Join Date
    06-04-2013
    Location
    Moscow
    MS-Off Ver
    Office 365
    Posts
    100

    Re: Lookup multiple values concatenated into one cell without duplicates

    Try this function:
    Please Login or Register  to view this content.
    Analog standart function Countif, but working with text.
    Source
    I'm sorry my english...

  3. #3
    Registered User
    Join Date
    07-18-2013
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Lookup multiple values concatenated into one cell without duplicates

    Hi.. Thank you for your quick response. I tried the code but could not follow it properly. It would be great if you can attach a sample file. I have also attached a data file which will better explain what I require.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    06-04-2013
    Location
    Moscow
    MS-Off Ver
    Office 365
    Posts
    100

    Re: Lookup multiple values concatenated into one cell without duplicates

    In attached file value "US-0000146" is not exists in first sheet. And other values also.
    My function must be writen:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Sample_CoupleIf.xlsm

+ 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] Match multiple substrings in a cell against a lookup table and return concatenated values
    By stevewc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 10:50 AM
  2. Replies: 10
    Last Post: 12-19-2012, 03:07 PM
  3. Lookup and then return multiple values concatenated
    By cjcass in forum Excel General
    Replies: 1
    Last Post: 11-01-2012, 03:19 AM
  4. Sum values from multiple cells - multiple lookup values in single cell
    By taxdept in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2012, 04:12 PM
  5. vba to Match concatenated values in concatenated columns
    By bjurick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2012, 03:45 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