JCScoobyRS
Board Regular
- Joined
- Sep 17, 2002
- Messages
- 102
I have a number, 0.0045, and I need to take off the first 0. I tried this with MID but I must had done it wrong as it didn't work. Any ideas? Thanks, Jeremy
On 2002-09-30 17:06, JCScoobyRS wrote:
I have a number, 0.0045, and I need to take off the first 0. I tried this with MID but I must had done it wrong as it didn't work. Any ideas? Thanks, Jeremy
On 2002-09-30 17:10, JCScoobyRS wrote:
.0045
On 2002-09-30 17:19, Aladin Akyurek wrote:
On 2002-09-30 17:10, JCScoobyRS wrote:
.0045
=IF(LEFT(A1)+0,A1,SUBSTITUTE(A1,LEFT(A1),"",1))
whose result will be a text-formatted number.
On 2002-09-30 17:51, Juan Pablo G. wrote:
On 2002-09-30 17:19, Aladin Akyurek wrote:
On 2002-09-30 17:10, JCScoobyRS wrote:
.0045
=IF(LEFT(A1)+0,A1,SUBSTITUTE(A1,LEFT(A1),"",1))
whose result will be a text-formatted number.
Aladin,
One question, why the SUBSTITUTE to replace the first occurrence of LEFT(A1), and not use RIGHT(A1,LEN(A1)-1) instead ? seems a bit strange to me... is it just a matter of style ?
On 2002-10-01 02:34, Aladin Akyurek wrote:
Juan,
I did too many substitutions lately... so it's maybe a recency effect... Both
=IF(LEFT(A1,2)<>"0.",A1,SUBSTITUTE(A1,LEFT(A1),"",1))
and
=IF(LEFT(A1,2)<>"0.",A1,RIGHT(A1,LEN(A1)-1))
would do.
The initial formula has, although good enough, a terse condition, hence expanded here...
BTW, why is SUBSTITUTE strange?