Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Zero value
Is there a way to get Excel to recognise a leading zero as a digit. Ie. Enter the number 0645 and multiply the first digits, 06, by a given number. IE.. ( 06 * 2 ) = 12 The only way I can do it, is to, Format column *A* as 0000, then enter 0645 at *A1* and at *B1* the formula [ *=MID(A1+10000000,3,2)*2* ] I know I could just enter the number as 645 and the formula, *=Left(A1,1)*2*, but I have a need to enter it with a leading zero. -- chequer Old battler ------------------------------------------------------------------------ chequer's Profile: http://www.excelforum.com/member.php...o&userid=36908 View this thread: http://www.excelforum.com/showthread...hreadid=566482 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Zero value
Enter it as
'0645 using a leading single quote. this will not show the single quote and will store the number as a string including the leading zero. =Left(A1,2)*2 -- Regards, Tom Ogilvy "chequer" wrote in message ... Is there a way to get Excel to recognise a leading zero as a digit. Ie. Enter the number 0645 and multiply the first digits, 06, by a given number. IE.. ( 06 * 2 ) = 12 The only way I can do it, is to, Format column *A* as 0000, then enter 0645 at *A1* and at *B1* the formula [ *=MID(A1+10000000,3,2)*2* ] I know I could just enter the number as 645 and the formula, *=Left(A1,1)*2*, but I have a need to enter it with a leading zero. -- chequer Old battler ------------------------------------------------------------------------ chequer's Profile: http://www.excelforum.com/member.php...o&userid=36908 View this thread: http://www.excelforum.com/showthread...hreadid=566482 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Zero value
Tom Ogilvy Wrote: Enter it as '0645 using a leading single quote. this will not show the single quote and will store the number as a string including the leading zero. =Left(A1,2)*2 -- Regards, Tom Ogilvy "chequer" wrote in message ... Is there a way to get Excel to recognise a leading zero as a digit. Ie. Enter the number 0645 and multiply the first digits, 06, by a given number. IE.. ( 06 * 2 ) = 12 The only way I can do it, is to, Format column *A* as 0000, then enter 0645 at *A1* and at *B1* the formula [ *=MID(A1+10000000,3,2)*2* ] I know I could just enter the number as 645 and the formula, *=Left(A1,1)*2*, but I have a need to enter it with a leading zero. -- chequer Old battler ------------------------------------------------------------------------ chequer's Profile: http://www.excelforum.com/member.php...o&userid=36908 View this thread: http://www.excelforum.com/showthread...hreadid=566482 Thank Tom, This works fine but I should have made myself clearer. I am converting a 'basic' program I wrote on an old Amstrad to an Excel program. This is for our Pigeon racing club members to use when I kick the bucket.. As none of the members know nothing about computers I have to make it as user friendly as possible. The program which calculates the pigeons race velocities, require entering a lot of times and converting them to seconds. To simplify entering these times, they are entered as:: ie 6:45am as *0645*, 7:45pm as *1945*, 2:40:54pm as *144054*. This does away with having to use the colon separator. The formulas I use for the conversions a *0645* =MID(A1+100000,3,2)*3600+RIGHT(A1,2)*60 *1945* =LEFT(A2,2)*3600+RIGHT(A2,2)*60 *144054* =MID(A3+10000000,3,2)*3600+MID(A3+10000000,5,2)*60 +RIGHT(A3,2) This also does away with them having to *remember* to enter the apostrophe before entering times earlier than 10:00am, as you suggested. -- chequer Old battler ------------------------------------------------------------------------ chequer's Profile: http://www.excelforum.com/member.php...o&userid=36908 View this thread: http://www.excelforum.com/showthread...hreadid=566482 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|