ERRORS: Conversion from String to type "Double" is not Valid & Input string was not in a correct format

I am trying to convert string cell in excel into a double format.
I tried several approaches:

  1. by using CDbl function - it is not working:
    image using Double.Parse function - not working as well
    image using Double.Parse(o, System.Globalization.CultureInfo.InvariantCulture) - I am getting the same error message: Input string was not in a correct format

I don´t have any more ideas, how to solve this one. Help please!
I am attaching bot at test .xslx file.
StrToDbl.xaml (8.8 KB) StrToDbl.xlsx (8.5 KB)

Hi @sspi1153,

in here the string type is not matching with the String to double conversion so simply you need to change the number format as flows before you enter into double casting then it’s working fine

Hi Saman,
not sure that I understand you correctly:
“change the number format as flows before”. How do you mean this?

in your string number format using the dot(.) as per the thousand separators and comma as a decimal separator that is the issue. you need to convert that into the way previously I mentioned


Ok, I see. Thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.