Zero problem

Closed
ahmadamy21 - Dec 19, 2008 at 12:17 PM
 ahmadamy21 - Dec 31, 2008 at 01:56 PM
Hello,
Hello,now i'm using function (LEFT(C5,3)+MID(C5,5,2)/60+MID(C5,7,2)/3600) to convert my data(142.5030) into decimal degree...142.5030 means 142 deg, 50 min and 30 sec. their no problem with MID(cell,num.start,character) if i insert 7 digits. the problem occur when i insert 6 digits. for example 42.5030. i cannot change the numb of character because i'm building a program and working witha lot of input data. so how i working with this degrees problem?

1 response

Since your minutes and seconds never change as far as character lengths, the trick is to know how long the character set for the degree is. Since you have 5 characters that will never change (your decimal, 2 characters for minutes and 2 characters for seconds), the length of the degree is the total length minus five.

Set your formula to left(c5,len(c5)-5)+mid(c5,len(c5)-3,2)+right(c5,2)
0
it's very helpful, thank you very much..
0