Hello. I am working Microsoft Office 2016 and I am trying to get a formula to work. I have a custom formula to use the TEXTJOIN function in Excel 2016, but i want to show it once. I am wondering if someone can help me
Here is the custom formula that i found for myvlookup
Data Warehouse.xlsx | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | 510000122 | Apple | Value 4 | |||
2 | 510000122763 | Cost Center | Value 1 | |||
3 | 510000122763 | Cost Center | Value 1 | |||
4 | 510000122763 | Cost Center & Payor1 | Value 2 | |||
5 | 510000122763 | Cost Center & Payor2 | Value 2 | |||
6 | 510000122763 | Cost Center | Value 2 | |||
7 | 510000122763 | Cost Center | Value 2 | |||
8 | 510000122859 | Apple | Value 3 | |||
9 | ||||||
10 | My result now | |||||
11 | 510000122 | 763 | Cost Center Cost Center Cost Center & Payor1 Cost Center & Payor2 Cost Center Cost Center | Value 1 Value 1 Value 2 Value 2 Value 2 Value 2 | ||
12 | 510000122 | 432 | ||||
13 | 510000122 | 859 | Apple | Value 3 | ||
14 | ||||||
15 | ||||||
16 | What I'm Trying to get | |||||
17 | 510000122 | 763 | Cost Center Cost Center & Payor1 Cost Center & Payor2 Cost Center | Value 1 Value 2 Value 2 Value 2 | ||
18 | 510000122 | 432 | Value 4 | |||
19 | 510000122 | 859 | Apple | Value 3 | ||
Sheet4 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C11:C13 | C11 | =myvlookup(A11&B11,$A$1:$C$8,2) |
D11:D13 | D11 | =myvlookup(A11&B11,$A$1:$C$8,3) |
Here is the custom formula that i found for myvlookup
VBA Code:
Function myvlookup(pValue As String, pWorkRng As Range, pIndex As Long)
For Each rng In pWorkRng
If rng = pValue Then
xResult = xResult & vbNewLine & rng.Offset(0, pIndex - 1)
End If
Next
myvlookup = Mid(xResult, 3)
End Function