Index Match Formula

nikhil0311

Board Regular
Joined
May 3, 2013
Messages
200
Office Version
  1. 2013
Platform
  1. Windows
Formula.xlsx
ABCDEFGHIJKL
1Output
2Sr No.IDNameCardReceivablesPayables
311456; 6678; 7654; 6590Mikel A; Harry k; Henry C; Lauren TMikel AHarry K-Mapping Table
422234;14567; 2780Thomas P; Declan R; Pankaj JDeclan R; Pankaj J-Thomas PIDNameProduct
534563; 8532; 76558Emile R-Emile R-1456Mikel ACard
6477943Ricky P---6678Harry KReceivables
77654Henry CReceivables
82234Thomas PPayables
914567Declan RCard
104563Emile RReceivables
112780Pankaj JCard
Sheet1


Hello People, Looking for your expertise in creating an excel formula.

  1. Column A,B & C has raw data. Column D,E & F is the final output I am looking for based on the mapping table present in column J,K & L
  2. So if you look at Sr. no 1, here we have 4 IDs in column B and their respective names in column C. Based on the name & product mapping present in column J, K & L, I want to segregate the names as per respective products in Output column D,E, F.
  3. If any name and product combination is not present in mapping table, it should put "-" in the output columns.
  4. If multiple names are present for the same product, it should keep both names in output (refer sr.no 2 Card example where (Declan R & Pankaj J) are present.

Thank you in advance for your help
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Are you using Excel 2013 or have you updated to 365?
 
Upvote 0
Hello team,
Just wondering if anyone got a solution for this requirement please!!
 
Upvote 0
If you are willing to use a UDF, then the below may help:
VBA Code:
Function GetData(idRng As Range, nameRng As Range, typeRng As Range, tblRng As Range) As Variant
    Dim idVar As Variant, x As Long, z As Long
    Dim nameVar As Variant
    Dim oVar() As Variant
    
    idVar = Split(Replace(idRng, " ", ""), ";")
    nameVar = Split(Replace(nameRng, " ", ""), ";")
    
    For x = 0 To UBound(idVar)
        If Application.CountIfs(tblRng.Columns(1), idVar(x), tblRng.Columns(3), typeRng) > 0 Then
            ReDim Preserve oVar(z)
            oVar(z) = nameVar(x)
            z = z + 1
        End If
    Next x
    GetData = Join(oVar, "; ")
End Function

Used in the sheet as below:
Book1
ABCDEFGHIJKL
1Output
2Sr No.IDNameCardReceivablesPayables
311456; 6678; 7654; 6590Mikel A; Harry k; Henry C; Lauren TMikelAHarryk; HenryC Mapping Table
422234;14567; 2780Thomas P; Declan R; Pankaj JDeclanR; PankajJ ThomasPIDNameProduct
534563; 8532; 76558Emile R EmileR 1456Mikel ACard
6477943Ricky P   6678Harry KReceivables
77654Henry CReceivables
82234Thomas PPayables
914567Declan RCard
104563Emile RReceivables
112780Pankaj JCard
Sheet1
Cell Formulas
RangeFormula
D3:F6D3=GetData($B3,$C3,D$2,$J$5:$L$11)
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,507
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top