| View previous topic :: View next topic |
| Author |
Message |
tfwil Newbie

Joined: 07 Jun 2008 Posts: 4
|
Posted: Sat Jun 07, 2008 8:40 am Post subject: vlookup with odd characters |
|
|
I am using vlookup to compare current values in a windows services dump vs older values, so my lookup table looks something like this...
COM Host;Started
COM+ Event System;Started
COM+ System Application;Started
vlookup has no problem finding the value "Started" for "COM Host", but returns #NA for any of the values with embedded "+" characters. If there a way to escape the string in the lookup , ie instead of "=VLOOKUP(A2;servs0.$A$2:$E$155;2;0)", I'd like "=VLOOKUP(actualstring(A2);servs0.$A$2:$E$155;2;0)". And how would that apply in the range itself? |
|
| Back to top |
|
 |
RickRandom Super User

Joined: 27 Jan 2006 Posts: 1082 Location: UK
|
Posted: Sat Jun 07, 2008 9:14 am Post subject: |
|
|
I don't know a direct solution, but perhaps create a helper column replacing the + with something more amenable to VLOOKUP
=LEFT(A1;FIND("+";A1)-1)&" "&RIGHT(A1;LEN(A1)-FIND("+";A1))
but perhaps using a database might be more effective (not that I know much about databases ). |
|
| Back to top |
|
 |
tfwil Newbie

Joined: 07 Jun 2008 Posts: 4
|
Posted: Sat Jun 07, 2008 10:57 am Post subject: |
|
|
Thanks for the quick reply. I tried inserting a new column A in both sheets, and then:
IF(ISERR(FIND("+";B2));B2;LEFT(B2;FIND("+";B2)-1)&" "&RIGHT(B2;LEN(B2)-FIND("+";B2)))
But now I see it doesn't like parends either. Seems like the parser for vlookup should not be interpreting the resolved content of a cell. Guess I'll need to write a macro, but it seems like I shouldn't have to. |
|
| Back to top |
|
 |
RickRandom Super User

Joined: 27 Jan 2006 Posts: 1082 Location: UK
|
Posted: Sat Jun 07, 2008 2:29 pm Post subject: |
|
|
| tfwil wrote: | | But now I see it doesn't like parends either. | Sorry, what are they? |
|
| Back to top |
|
 |
tfwil Newbie

Joined: 07 Jun 2008 Posts: 4
|
Posted: Sun Jun 08, 2008 8:45 am Post subject: |
|
|
Sorry, I mean parens, like left parenthesis and right parenthesis, as in
Intel(R) Alert Service
Ended up with this, after creating a new column, eliminating "+","(" and ")" and replacing with ":" which it seems to like.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2;"(";":");")";":");"+";":")
Thanks for all your help |
|
| Back to top |
|
 |
|