Smartgambler
Pro-Punter

Go Back   OZmium Sports Betting and Horse Racing Forums > Public Forums > General Topics
User Name
Password
Register FAQ Search Today's Posts Mark all topics as read

To advertise on these
forums, e-mail us.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th January 2016, 02:14 PM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default Excel Time Format Issue

I thought i would ask this in a new topic, i have imported data that displays like this.

Race 1 - 12:25PM Michael Stewart Plate (1100 METRES)

i am using this code to try and force it to 24 hour time.

=TEXT(TRIM(CLEAN(MID(LEFT(Q14,FIND("M",Q14)+1),FIND("-",Q14)+1,10))),"hh:mm:ss")

But having no luck, any ideas would be helpful.
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote
  #2  
Old 30th January 2016, 03:44 PM
walkermac walkermac is offline
Member
 
Join Date: Nov 2013
Posts: 600
Default

There has to be an easier way of doing this (surely?!) but:
Code:
=TEXT(LEFT(MID(Q14,FIND("-",Q14)+2,FIND("M ",Q14)-FIND("-",Q14)-1),LEN(MID(Q14,FIND("-",Q14)+2,FIND("M ",Q14)-FIND("-",Q14)-1))-2) & " " & RIGHT(MID(Q14,FIND("-",Q14)+2,FIND("M ",Q14)-FIND("-",Q14)-1),2),"[H]:mm")


It's particularly lengthy so that it can handle X:XX and XX:XX format times. Tested with 9:30AM, 10:30AM, 1:30PM and 10:30PM, with the results you would expect.

There are undoubtedly better ways, the two necessary points are:
1 - the format needs to be "[H]:mm" for 24 hour time
2 - the string you send it needs to have a space between the time figures and the AM/PM for it to correctly recognise it

Last edited by walkermac : 30th January 2016 at 03:48 PM.
Reply With Quote
  #3  
Old 30th January 2016, 04:26 PM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

Thanks, and yes there is.

=TEXT(REPLACE(LEFT(Q14,FIND("M",Q14)-2),1,FIND("-",Q14)+1,"")+0.5*(MID(Q14,FIND("M",Q14)-1,1)="P"),"hh:mm")


Your's was a huge effort, i am not even going to try and understand what all that does,lol

I am, only good with less complex formulas.
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________

Last edited by Shaun : 30th January 2016 at 04:28 PM.
Reply With Quote
  #4  
Old 4th February 2016, 01:11 PM
Chrome Prince Chrome Prince is offline
Member
 
Join Date: Jan 1970
Posts: 4,363
Default

How about text to columns, using delimiters, and find replace AM and then PM with a blank.
Then format that column special h:mm.
__________________
RaceCensus - powerful system testing software.
Now with over 399,000 Metropolitan, Provincial and Country races!
http://www.propun.com.au/horse_raci...ng_systems.html
*RaceCensus now updated to 31/03/2024
Video overview of RaceCensus here:
http://www.youtube.com/watch?v=W821YP_b0Pg
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump



All times are GMT +10. The time now is 10:06 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2008 OZmium Pty. Ltd. All rights reserved . ACN 091184655