Req: assist with specific nested substitute formula

irvpost

New Member
Joined
Jul 28, 2011
Messages
5
I have logfiles that output data out of order on a daily basis.
the format is xxxxxxx:xxxxxxxx:NNNNNNN.N the lines are variable length but always have 2 or 3 colons separating the text from the last field of numbers. Usually 8 char but have a couple up to 20. I have a formula that i have been trying to get to work but am having trouble with the substitute portion. I need everything to the right of the last :.
here is an example of the data--
Begin***
Voice quality: packet loss: 0.06977094002973731
Voice quality: jitter: 2.278952585494796
Voice quality: round trip delay: 22.318643453028653
Voice quality: estimated RTP bandwidth: 1.496161450704676
Voice quality: call legs with VQM statistics: 12106.0
End***

The formula i was trying to use is-
Begin formula***

=IF(ISERROR(SEARCH(":",A1)>0),"",LEN(A1)-LEN(SUBSTITUTE(A1,":",""))SUBSTITUTE(A1,":","_",LEN(A1)-LEN(SUBSTITUTE(A1,":",""))))FIND("_",SUBSTITUTE(A1,":","_",LEN(A1)-LEN(SUBSTITUTE(A1,":",""))))+1

End Formula***

It works up until just after i count the number of colons.

Any help would be greatly appreciated as I have about 2 years worth of stats to organize ( 6 or 7 million lines ).
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I have logfiles that output data out of order on a daily basis.
the format is xxxxxxx:xxxxxxxx:NNNNNNN.N the lines are variable length but always have 2 or 3 colons separating the text from the last field of numbers. Usually 8 char but have a couple up to 20. I have a formula that i have been trying to get to work but am having trouble with the substitute portion. I need everything to the right of the last :.
here is an example of the data--
Begin***
Voice quality: packet loss: 0.06977094002973731
Voice quality: jitter: 2.278952585494796
Voice quality: round trip delay: 22.318643453028653
Voice quality: estimated RTP bandwidth: 1.496161450704676
Voice quality: call legs with VQM statistics: 12106.0
End***

The formula i was trying to use is-
Begin formula***

=IF(ISERROR(SEARCH(":",A1)>0),"",LEN(A1)-LEN(SUBSTITUTE(A1,":",""))SUBSTITUTE(A1,":","_",LEN(A1)-LEN(SUBSTITUTE(A1,":",""))))FIND("_",SUBSTITUTE(A1,":","_",LEN(A1)-LEN(SUBSTITUTE(A1,":",""))))+1

End Formula***

It works up until just after i count the number of colons.

Any help would be greatly appreciated as I have about 2 years worth of stats to organize ( 6 or 7 million lines ).
It looks like you can use the last space character as the target.

Try this...

=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))

Note that that will extract the number string as a TEXT value.

Some of your numbers are too long for Excel to evalaute them as numbers so you'd have to extract them as TEXT strings.
 
Upvote 0
Thank you for you concise clean and complete answer. I felt a little silly after seeing how simple you you solved my meandering formula.
Thanks again.
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top