Converting a column of negative numbers into positive numbers in excel

I need help to convert a column of negative numbers into positive number using excel for a project, ive looked on other forumns but their solutions doesnt work, im using the 2023.10.3 version.

@Rule_Outlaw,

Welcome to the UiPath Community :tada:

You can use Format Cells activity to achieve this like this. Set the Format to Custom and provide this 0.00;0.00 as format.

image

Thanks,
Ashok :slight_smile:

1 Like

Hi @Rule_Outlaw

Can you try the below

Input:

image

Output:

image

Cheers!!

1 Like

This method works but due to my school project restriction on using this, is there any other method like using data table etc?

@Rule_Outlaw

Try this

CurrentRow("Credit Amount")=Math.Abs(CDec(CurrentRow("Credit Amount"))).ToString("#,##0.00")

Output:

image

Regards,


It didn’t work, my version is 2023.10.3 version

@Rule_Outlaw

Try this

CurrentRow("Credit Amount").ToString.Replace("-","")
1 Like

Oh my god it worked, thank you so much my assignment is due 10 minutes your a life saver.

1 Like

@Rule_Outlaw

FYI, there is another approach

dt.AsEnumerable.ToList.ForEach(Sub(r)
    r("Credit Amount")=r("Credit Amount").ToString.Replace("-","")
End Sub
)

Cheers!!

1 Like

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