Welcome Guest. Sign in or Signup

I have a that I import numbers into from a program. The problem I have is that the numbers that come in are in 1/8ths instead of . For example 300.5 (half) will come in as 300.4. Is there any way to write a macro to convert all the XXX.4 to XXX.5? I need to do this for all the 1/8th. Another example 302.2 should be 302.25. XXX=.1 =XXX.125 XXX.3=XXX.375, XXX.5=XXX.625. Would it be possible to create a macro that does that? I have no at all and info on where to get started would be great. This worksheet has about 500 a day and entered them manually is a pain. thanks
Just to clear something up, the numbers before the should stay the same. I only need to change the number after the .
I tried to the formula that you gave but I’m getting a #
Actually the equation works great except when I have whole numbers for example 330.0. Thats when it returns the #value error. For all the it works fine.
Thank cozmosis the formula works great can’t wait to show it to the bosses at work on Monday.

Also want to thank you _xom’s your updated solution also works.

Tags: , , , , , , , , , ,

Related posts

2 Answers



  1. cozmosis on May 25, 2011

    Try this formula to convert the decimals…
    =INT(A1)+(A1-INT(A1))*10/8

    If A1 = xxx.3 it will convert it to xxx.375



  2. expletive_xom on May 25, 2011

    i dont know how to write a macro for this.
    but maybe you can just use a formula to convert the numbers.
    are you trying to do something like this
    if your data is in column A (starting in cell A1)
    then copy&paste this into B1

    =INT(A1)+RIGHT(A1, LEN(A1)-LEN(INT(A1))-1)/8

    then copy B1 and paste the formuladown the column.
    that should convert the numbers to what you are looking for.

    edit-
    you are right…try this instead

    =IF(MOD(A1,1)=0,A1,INT(A1)+RIGHT(A1, LEN(A1)-LEN(INT(A1))-1)/8)

    or i see cozmosis put together a more efficient formula, and thats always the best way to go (o:


Answer Question

Get Adobe Flash player