Convert half hour to hour using military time

tblackwell

New Member
Joined
Oct 24, 2018
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Newb here so bear with me if the answer is obvious!

Situation
: Trying to convert field of half hour with that contain no ":" to full hours using military time. It's relatively easy for half hours that contain four characters.
Hypothetical Example: =left(text,[num_char]) for "1000" returns the desired result of "10"
Problem: =left(text,[num_char]) for "930" returns "93" when my desired result is "9"
Current formula where I get stuck: not sure what formula i need beyond: =left(text,[num_char])
System: Windows 10 Pro

Appreciate any help you can provide on the right formula for column M!

ABCDEFGHIJKLM
1half hour breakoutdesired resultgood formulaproblem childrendesired resultbad formula resultgood formula
200030030?
310001010930993?
410301010930993?
51100111130030?
611301111530553?
712001212800880?
812301212930993?
91300131330030?
101330131330030?
1114001414930993?
121430141430030?
1315001515630663?
1415301515700770?
1516001616730773?
1616301616800880?
1717001717830883?
1817301717900990?
1918001818930993?
2018301818700770?
2119001919730773?
2219301919800880?
2320002020830883?
2420302020900990?
2521002121930993?
2621302121730773?
2722002222800880?
2822302222830883?
2923002323900990?
3023302323930993?
3130030?
32900990?
3330030?
34630663?
35700770?

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E2=LEFT(A2,2)
E3=LEFT(A3,2)
E4=LEFT(A4,2)
E5=LEFT(A5,2)
E6=LEFT(A6,2)
E7=LEFT(A7,2)
E8=LEFT(A8,2)
E9=LEFT(A9,2)
E10=LEFT(A10,2)
E11=LEFT(A11,2)
E12=LEFT(A12,2)
E13=LEFT(A13,2)
E14=LEFT(A14,2)
E15=LEFT(A15,2)
E16=LEFT(A16,2)
E17=LEFT(A17,2)
E18=LEFT(A18,2)
E19=LEFT(A19,2)
E20=LEFT(A20,2)
E21=LEFT(A21,2)
E22=LEFT(A22,2)
E23=LEFT(A23,2)
E24=LEFT(A24,2)
E25=LEFT(A25,2)
E26=LEFT(A26,2)
E27=LEFT(A27,2)
E28=LEFT(A28,2)
E29=LEFT(A29,2)
E30=LEFT(A30,2)
K2=LEFT(G2,2)
K3=LEFT(G3,2)
K4=LEFT(G4,2)
K5=LEFT(G5,2)
K6=LEFT(G6,2)
K7=LEFT(G7,2)
K8=LEFT(G8,2)
K9=LEFT(G9,2)
K10=LEFT(G10,2)
K11=LEFT(G11,2)
K12=LEFT(G12,2)
K13=LEFT(G13,2)
K14=LEFT(G14,2)
K15=LEFT(G15,2)
K16=LEFT(G16,2)
K17=LEFT(G17,2)
K18=LEFT(G18,2)
K19=LEFT(G19,2)
K20=LEFT(G20,2)
K21=LEFT(G21,2)
K22=LEFT(G22,2)
K23=LEFT(G23,2)
K24=LEFT(G24,2)
K25=LEFT(G25,2)
K26=LEFT(G26,2)
K27=LEFT(G27,2)
K28=LEFT(G28,2)
K29=LEFT(G29,2)
K30=LEFT(G30,2)
K31=LEFT(G31,2)
K32=LEFT(G32,2)
K33=LEFT(G33,2)
K34=LEFT(G34,2)
K35=LEFT(G35,2)

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I would think storing time as a time values would be the first thing to look at.
Format cells as "hmm;@" or "hhmm;@"
Then you only need =HOUR(A1)

Of course this may be dependent on where these values are coming from.
 
Upvote 0
Geez I didn't even know about the INT function. It seems so obvious now. Thanks Rick Rothstein! And thanks Fluff, because your solution worked too. Need to start integrating LEN more.

QQ: When a problem is solved is there a feature in the forum to note that? Or do I just give thanks and likes?
 
Upvote 0
Glad we could help & thanks for the feedback.

We don't allow threads to be marked as solved, If you wish to click Thanks/Likes you are welcome to do so, but it's not mandatory.
 
Upvote 0

Forum statistics

Threads
1,215,259
Messages
6,123,922
Members
449,135
Latest member
NickWBA

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