3 Replies Latest reply: May 15, 2014 10:01 AM by Data Kruncher RSS

    Feet and Inches conversion

    Nick Osdale-Popa

      Has anyone created any Monarch formulas to convert Feet and Inches into decimal?


      I have two Excel UDFs that can convert back and forth, but they use FOR..NEXT loops, so it's not that easy to convert them to Monarch.


      Here's a sample of my data:

      Item               Size             Length

      No-Hub Pipe           2             95'-4 7/8"

      No-Hub Pipe           3             9'-8"

      No-Hub Pipe           4             72'-3 5/8"

      No-Hub Pipe           6             81'-1 7/8"

      No-Hub Pipe           8             32'-0 7/8"


        • Feet and Inches conversion
          Data Kruncher

          Bit sized bits here. Feel free to consolidate or otherwise optimize.


          Trap the initial field as character, named "Pre Length". Now we need some calculated fields:


          Pre Inches (character):



          Inches (numeric):

          [SIZE=2]Val(LSplit(,2," ",1))[/SIZE][/code]


          Fraction (character:

          [SIZE=2]if(instr(" ",[Pre Inches])=0,"",RSplit(,2," ",1))[/SIZE][/code]


          Decimal (numeric):



          Feet (numeric):



          Length (numeric):



          That, er, measure up for you?


          Edit: I missed factoring in the inches, and dividing inches+decimal by 12 to get decimal feet!


          So close and yet so far!


          Final Length field should be: