How to get "NaN" value in string variable?

I am writing data to Excel sheet, but it gets “NaN” value.
I am wanting to somehow check this value using if activity, but I haven’t been able to. I am writing to file using Write Range.
This data initially comes from another Excel sheet, and it is a number.

I tried the following but it never caught it.

if myValue.ToString Is Nothing
if myValue.ToString.Trim Is “NaN”
if string.IsNullOrEmpty(mValue.ToString)

I want the evaluation to be TRUE, but it is returning false… how can I get the right condition to handle “NaN” value?

Hi @tomato25

Based on string you can use the condition as strvar.ToString.contains(“NAN”)


1 Like

Once you read the source excel before writing it into the target excel check for the value you want to identify and change.
If you reading the source excel as datatable then check the whole datatable before writing.

1 Like

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