+ Reply to Thread
Results 1 to 8 of 8

Rounding Vectors based on length of line

Hybrid View

  1. #1
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,534

    Re: Rounding Vectors based on length of line

    I think, rather than combine degrees/minutes/seconds into one "number", I'd try to separate them out. This would be pretty easy with the Text to Columns command on the Data menu.

    Then, you can use the =vlookup() function to return the multiple to round the seconds to. Something like =vlookup(949.393,{0,10;251,5;501,1})
    Then, as you noted, use the MROUND function to get the rounding. =MROUND(17,vlookup(949.393,{0,10;251,5;501,1},2)) should return 17.

    Replace the values with references to cells with those values as desired. It might also be preferable to pull the lookup table out and have it in the spreadsheet rather than hard coded into the function.

    At this point, it would be easy enough to use the concatenate function to put it back into the 0° 0' 0'' format if desired.

  2. #2
    Registered User
    Join Date
    06-18-2012
    Location
    New Zealand
    MS-Off Ver
    Excel 2002
    Posts
    7

    Re: Rounding Vectors based on length of line

    Thank you MrShorty.

    I based the function I will now use on your recommendations.

    The desired format of the angle is without symbols. The reason being is it can then be imported directly into the survey software I use.

    Therefore I used a combination of your recommendation and my initial attempt.

    The end result is:

    =(MROUND(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(L4,"° ","."),"' ",""),"""",""),VLOOKUP(M4,{0,0.001;251,0.0005;501,0.0001},2)))

    where L4 contains the angle value and M4 the distance value.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1