Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
fiber_doc
 
Posts: n/a
Default EXTRACT NUMBERS FROM TEXT STRING

Hey Guys,
I have a text string with numbers that I need to separate into adjoining
columns.
Example:
HBFO(144)(144)(36)(24)(24)[6] This is a bid item on a government project.
Each number enclosed in parenthesis represents a fiber optic cable. I need
to extract the different numbers and place each of them in a separate column
for calculating the bid,,i.e
A B C D
E F G
HBFO(144)(144)(36)(24)(24)[6] 144 144 36 24 24 6

Your help will be greatly appreciated
Private email, OK

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default EXTRACT NUMBERS FROM TEXT STRING

Hi

One way. Firstly make a COPY of your data.
Ensure you have blank columns B:G, with your data in column A.
Mark the block of data in column A.
DataText to ColumnsDelimitedcheck Other and put ( as the other separator
Finish

Mark column F and repeat process, but change delimiter to [
Press Ctrl+H to bring up Find and Replace, in the Find pane type ( and leave
Replace blank, pres Replace All.
Repeat with [ in Find Pane.

Regards

Roger Govier


fiber_doc wrote:
Hey Guys,
I have a text string with numbers that I need to separate into adjoining
columns.
Example:
HBFO(144)(144)(36)(24)(24)[6] This is a bid item on a government project.
Each number enclosed in parenthesis represents a fiber optic cable. I need
to extract the different numbers and place each of them in a separate column
for calculating the bid,,i.e
A B C D
E F G
HBFO(144)(144)(36)(24)(24)[6] 144 144 36 24 24 6

Your help will be greatly appreciated
Private email, OK

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default EXTRACT NUMBERS FROM TEXT STRING

I'd use a find/replace to delete each ) and ], and to change [ to (. Then
use Data Text to Columns, indicating that the columns are delimited by (.

"fiber_doc" wrote:

Hey Guys,
I have a text string with numbers that I need to separate into adjoining
columns.
Example:
HBFO(144)(144)(36)(24)(24)[6] This is a bid item on a government project.
Each number enclosed in parenthesis represents a fiber optic cable. I need
to extract the different numbers and place each of them in a separate column
for calculating the bid,,i.e
A B C D
E F G
HBFO(144)(144)(36)(24)(24)[6] 144 144 36 24 24 6

Your help will be greatly appreciated
Private email, OK

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
fiber_doc
 
Posts: n/a
Default EXTRACT NUMBERS FROM TEXT STRING

Thanks for your reply. It worked but with only 1 problem. I need the
numbers enclosed in brackets "[ ]" to all line up in the same column. They
are the number of service drops at that location and a lot of calculations
depend on the info in the "Drops" column. Is there anyway to automate this
process with VBA or a built-in function?

I recently purchased John Walkenbach's "Excel 2003 Formulas" and "Power
Programming with VBA" but do not yet understand what I'm doing, or more
correctly, what the statements in VBA are doing.

"Roger Govier" wrote:

Hi

One way. Firstly make a COPY of your data.
Ensure you have blank columns B:G, with your data in column A.
Mark the block of data in column A.
DataText to ColumnsDelimitedcheck Other and put ( as the other separator
Finish

Mark column F and repeat process, but change delimiter to [
Press Ctrl+H to bring up Find and Replace, in the Find pane type ( and leave
Replace blank, pres Replace All.
Repeat with [ in Find Pane.

Regards

Roger Govier


fiber_doc wrote:
Hey Guys,
I have a text string with numbers that I need to separate into adjoining
columns.
Example:
HBFO(144)(144)(36)(24)(24)[6] This is a bid item on a government project.
Each number enclosed in parenthesis represents a fiber optic cable. I need
to extract the different numbers and place each of them in a separate column
for calculating the bid,,i.e
A B C D
E F G
HBFO(144)(144)(36)(24)(24)[6] 144 144 36 24 24 6

Your help will be greatly appreciated
Private email, OK


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default EXTRACT NUMBERS FROM TEXT STRING

Hi

Sorry for the delay in response, but I have been off-line for a few days.
If you are saying you want to retain the [ ] around the data for the last
column, one way would be to do a Find and Replace before you start.

Press Ctrl+H to bring up Find and Replace, in the Find pane type [ and in
the Replace pane type ([, Replace All.
Now, the DataText to columns only needs to be done with ( as the delimiter,
and, you final Find and Replace only needs to be done to remove the ).

If you want to Automate it, turn on the Macro Recorder before going through
the various steps.
ToolsMacroRecord carry out the different stages of the task, then switch
off the recorder at the end by pressing the "X" on the little bar that
appears on the screen when you turn it on.

When you want to re-use it, just ToolsMacroMacros and select the Macro.
Alternatively, when you have the Macro selected, go to Options and give it a
shortcut key like Ctrl+q. Then whenever you need to run it, just press Ctrl+q.

I would do a few practice runs first to familiarise yourself with the steps,
before you try recording.


Regards

Roger Govier


fiber_doc wrote:
Thanks for your reply. It worked but with only 1 problem. I need the
numbers enclosed in brackets "[ ]" to all line up in the same column. They
are the number of service drops at that location and a lot of calculations
depend on the info in the "Drops" column. Is there anyway to automate this
process with VBA or a built-in function?

I recently purchased John Walkenbach's "Excel 2003 Formulas" and "Power
Programming with VBA" but do not yet understand what I'm doing, or more
correctly, what the statements in VBA are doing.

"Roger Govier" wrote:


Hi

One way. Firstly make a COPY of your data.
Ensure you have blank columns B:G, with your data in column A.
Mark the block of data in column A.
DataText to ColumnsDelimitedcheck Other and put ( as the other separator
Finish

Mark column F and repeat process, but change delimiter to [
Press Ctrl+H to bring up Find and Replace, in the Find pane type ( and leave
Replace blank, pres Replace All.
Repeat with [ in Find Pane.

Regards

Roger Govier


fiber_doc wrote:

Hey Guys,
I have a text string with numbers that I need to separate into adjoining
columns.
Example:
HBFO(144)(144)(36)(24)(24)[6] This is a bid item on a government project.
Each number enclosed in parenthesis represents a fiber optic cable. I need
to extract the different numbers and place each of them in a separate column
for calculating the bid,,i.e
A B C D
E F G
HBFO(144)(144)(36)(24)(24)[6] 144 144 36 24 24 6

Your help will be greatly appreciated
Private email, OK


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
Extract Numbers from Alpha-Numeric String MrBill Excel Worksheet Functions 1 November 2nd 05 05:44 PM
Convert text numbers to numbers Barb Excel Worksheet Functions 4 October 22nd 05 07:18 PM
How do I look up a number within a string of text Rich Hayes Excel Worksheet Functions 3 October 14th 05 05:49 PM
How to convert Excel imported numbers from text to numbers? Alden Excel Discussion (Misc queries) 9 April 1st 05 09:51 PM
Converting Numbers to Text properly Shirley Munro Excel Discussion (Misc queries) 1 February 16th 05 03:01 PM


All times are GMT +1. The time now is 08:20 PM.

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"