cancel
Showing results for 
Search instead for 
Did you mean: 

I cannot calculate the difference between two data.

bazygon
Level 3

I would like to count differnece betwen past day price and current price of BTC.

30932.png

 I think that the problem might be with "$" and "," in my text data. What should I do to fix this? My idea with ToNumber Doesn't work. 30933.png



------------------------------
Norbert Florczak
------------------------------
1 BEST ANSWER

Helpful Answers

Hello Norbert,

You are thinking correctly, you can't cast that when there's a character that is not a number. You can solve that by simply using a nested function

ToNumber(Replace([BTC Past Day Price ],"$",""))

Before convert, you have to replace the characters that are not a number. 

Regards



------------------------------
Daniel Sanhueza
RPA Professional Developer
Deloitte
America/Santiago
------------------------------
Daniel Sanhueza
RPA Professional Developer
Deloitte

View answer in original post

3 REPLIES 3

Hello Norbert,

You are thinking correctly, you can't cast that when there's a character that is not a number. You can solve that by simply using a nested function

ToNumber(Replace([BTC Past Day Price ],"$",""))

Before convert, you have to replace the characters that are not a number. 

Regards



------------------------------
Daniel Sanhueza
RPA Professional Developer
Deloitte
America/Santiago
------------------------------
Daniel Sanhueza
RPA Professional Developer
Deloitte

Thank you very much for your help!



------------------------------
Norbert Florczak
------------------------------

asilarow
MVP

You can also do it without replacing any characters:

ToNumber(Right([BTC Past Day Price],Len([BTC Past Day Price])-1))

This is assuming that the dollar sign will always be present, and as the first character from the left.

If it's variable, then you will need to use InStr() to find it first, and then calculate how many characters to use based on its location.

Andrzej Silarow