Link to home
Start Free TrialLog in
Avatar of newparadigmz
newparadigmzFlag for United States of America

asked on

Excel, vlookup

How can I produce the following vlookup?


jack      123
joe      456
james      789


jack / joe / james:      123 / 456 / 789
Avatar of rspahitz
rspahitz
Flag of United States of America image

Not exactly sure what you're asking, but...
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
Avatar of newparadigmz

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.
Avatar of Steve
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.
ASKER CERTIFIED SOLUTION
Avatar of newparadigmz
newparadigmz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
no solution