LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Extracting Numeric Data from a Delimited Text String

Difficulty - No VBA Preferably

I'm trying to pull numeric data from an imported CSV file. The data I
am trying to pull is in a DDD:HH:MM:SS format. I've already written a
function that pulls the data from those fixed fields...

=IF(A2=0,0,SUM(SUM(24*(VALUE(LEFT(A2,3))))+(VALUE( MID(A2,5,2)))+(SUM(VALUE(MID(A2,8,2)))/60)))

What the function does is convert the DDD:HH:MM into a decimal form
which is easier to read and to perform additional functions with.

Here's the problem....most of the data comes into the exported csv file
like this...

000:11:05:46 ---- function ---- 11.08 CORRECT!

But on occasion, it exports like this....

00:11:05:46 ---- 0.05 ---- NOT CORRECT!

The problem with my function is that is the date field is shortened, it
screws up the answer completely. What I need is a way to pull the
numerical data out of the field by using the ":" instead of just using
fixed characters. I've obviously rewritten the formula in those
specific cases, but I was looking for something more elegant if it
exists. Also, I really don't want to use "Text to Columns" since this
worksheet will eventually be used by a bunch of people and I'm trying
to make it as user friendly as possible.

Thanks,
Brian

 
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
Extrapolate numeric values from text string Henrik Excel Worksheet Functions 4 November 3rd 05 06:25 PM
Search/Extract Data w/in Text File D.Parker Excel Discussion (Misc queries) 4 June 21st 05 07:33 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 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 numeric values from string RJF Excel Worksheet Functions 3 January 5th 05 10:48 PM


All times are GMT +1. The time now is 08:47 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"