Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LFM LFM is offline
external usenet poster
 
Posts: 3
Default Formula for extracting data from a string

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default Formula for extracting data from a string

With your Server name in A1:

=MID(A1,FIND("\\",A1)+2,FIND("\",A1,FIND("\\",A1)+ 2)-3)

HTH,
Paul

"LFM" wrote in message
oups.com...
I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Naz Naz is offline
external usenet poster
 
Posts: 85
Default Formula for extracting data from a string

Hi try

=MID(A1,3,FIND("\",A1,3)-3)

where A1 is your drive descrip

--

_______________________
Naz,
London


"LFM" wrote:

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Formula for extracting data from a string

Try:

=MID(A1,3,FIND("\",A1,3)-3)

"LFM" wrote:

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Formula for extracting data from a string

How about EditReplace

What: \

With: nothing

Replace all.

If you want them both in same cell, enter =A1&" and " &A2 in an adjacent cell.



Gord Dibben MS Excel MVP


On 11 Apr 2007 14:12:13 -0700, "LFM" wrote:

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Formula for extracting data from a string

The OP probably didn't want the "user" part left in the string?
--
David Biddulph

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
How about EditReplace

What: \

With: nothing

Replace all.

If you want them both in same cell, enter =A1&" and " &A2 in an adjacent
cell.



Gord Dibben MS Excel MVP


On 11 Apr 2007 14:12:13 -0700, "LFM" wrote:

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LFM LFM is offline
external usenet poster
 
Posts: 3
Default Formula for extracting data from a string

long story short - because the table that has the full information is
needed for its own functions, but in another area of the speadsheet I
need a table that only has the server name.

On Apr 11, 5:29 pm, Gord Dibben <gorddibbATshawDOTca wrote:
How about EditReplace

What: \

With: nothing

Replace all.

If you want them both in same cell, enter =A1&" and " &A2 in an adjacent cell.

Gord Dibben MS Excel MVP


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Formula for extracting data from a string

=MID(A1,3,FIND("\",MID(A1,3,999))-1)
--
David Biddulph

"LFM" wrote in message
oups.com...
I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LFM LFM is offline
external usenet poster
 
Posts: 3
Default Formula for extracting data from a string

Thank you to David, Toppers, Naz and Paul, all three varieties did the
trick. I've never played with the FIND function, so I'm going to go
play around with that one.

On Apr 11, 5:16 pm, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
=MID(A1,3,FIND("\",MID(A1,3,999))-1)
--
David Biddulph


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Formula for extracting data from a string

Try this:

=SUBSTITUTE(SUBSTITUTE(A1,"\",""),"user","")


"LFM" wrote:

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.




  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Formula for extracting data from a string

If "user" can have more than one value, try this one-line UDF:

Function server(r As Range) As String
server = Split(r.Value, "\")(2)
End Function
--
Gary''s Student - gsnu200714


"LFM" wrote:

I have a spreadsheet of UNC drive mappings. I need to extract out
just the name of the server from the fields.

Example:
\\SERVER01\user
\\SRV02\user

I need to have a cell that only reads: SERVER01 and SRV02

The data entry is consistent with the backslashes "\\" then the server
name then "\" but the length of the server name can vary. I tried a
MID function, but since I do not have a consistent length, I need
something a bit better.

If anyone can assisst me in the proper formula, I would greatly
appreciate it.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a string Peter Rooney Excel Discussion (Misc queries) 5 June 20th 06 06:34 PM
Extracting Numeric Data from a Delimited Text String [email protected] Excel Worksheet Functions 5 February 10th 06 10:29 PM
Extracting from a text string AmyTaylor Excel Worksheet Functions 3 June 24th 05 01:34 PM
extracting data from a text string of varying length andy from maine Excel Discussion (Misc queries) 4 March 28th 05 07:11 PM
extracting numbers from string Chris Dowell via OfficeKB.com Excel Discussion (Misc queries) 1 January 12th 05 09:37 PM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"