Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

if statement with text and number error

Trying to convert a mixed column of letters and numbers to all numbers.  It is giving me an error when it actually is a number in the column.  

 

Where you see "Error" in the "Unit Per ASSY Fix", I need the number value in "UNIT PER ASSY"

 

  • KGrice's avatar
    KGrice
    10 years ago

    That error still seems odd and I'd like to figure it out just to learn, but if all you want to do is grab the number and otherwise count it as 0, you could bypass the whole conditional column and try Add Custom Column instead. Use the formula below:

     

    =try Number.From([UNIT PER ASSY]) otherwise 0

6 Replies

  • KGrice's avatar
    KGrice
    Icon for Memorable Member rankMemorable Member

    I tried to recreate and don't get the error. Can you click in the white space of the one the cells, next to the word Error? That should give an idea of what's going on in a message at the bottom.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Here is the error

  • Vvelarde's avatar
    Vvelarde
    Icon for Community Champion rankCommunity Champion

    Anonymous

     

    Your decimal is with . or with ,

     

    Maybe change this in Conditional colum 0,0 instead 0.0

    • Anonymous's avatar
      Anonymous
      Not applicable

      I started by just putting in 0 but I changed it to 0.0 to see if that would fix the problem. 

       

      So in short, I would like it to be 0 if the column is non-numeric and the number if a number.

      • KGrice's avatar
        KGrice
        Icon for Memorable Member rankMemorable Member

        That error still seems odd and I'd like to figure it out just to learn, but if all you want to do is grab the number and otherwise count it as 0, you could bypass the whole conditional column and try Add Custom Column instead. Use the formula below:

         

        =try Number.From([UNIT PER ASSY]) otherwise 0