newparadigmz
asked on
Excel, vlookup
How can I produce the following vlookup?
jack 123
joe 456
james 789
jack / joe / james: 123 / 456 / 789
jack 123
joe 456
james 789
jack / joe / james: 123 / 456 / 789
ASKER
the number of names and /'s are unknown, need a formula that will work for that, and produce a 1 string result.
Without going into macros, Excel doesn't really support any kind of "looping" function other than things like SUM.
In your case, you may want to add a new formula to column C and D like this:
C1 =A1, D1 =B1
C2 =C1&" / " & A2, D2 =D1 & " / " & B2
copy the above formula down to the last row of names and you should have your results
To complete if you may want to put this in column E:
=C1 & ": " & D1
and copy it down.
In your case, you may want to add a new formula to column C and D like this:
C1 =A1, D1 =B1
C2 =C1&" / " & A2, D2 =D1 & " / " & B2
copy the above formula down to the last row of names and you should have your results
To complete if you may want to put this in column E:
=C1 & ": " & D1
and copy it down.
newparadigmz,
Would you like a specific VBA solution creating to provide the functionality you require?
It would not be too hard to provide the required result using code, but not all people like to have code in their workbooks.
ATB
Steve.
Would you like a specific VBA solution creating to provide the functionality you require?
It would not be too hard to provide the required result using code, but not all people like to have code in their workbooks.
ATB
Steve.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I offered a simple formula, but it had to be applied to several functions. Did you try it? It would have saved you all that time you took to do it manually.
ASKER
no solution
if your data is in columns A and B:
=VLOOKUP("jack", A:B, 2, false)
will give you 123
=VLOOKUP("joe", A:B, 2, false)
will give you 456
=VLOOKUP("james", A:B, 2, false)
will give you 789