• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

removing a digit

Richmandudeus

New Member
Hi all, my name is Rich.

So in a nutshell, i need excel to report back what is in a cell without the digit imidiately after a decimal.
ex.
before after
7.0179 7.179
4.0170 4.170
2A.0158 2A.158

So a couple things to keep in mind...
1. i was losing last zero due to rounding and it needs to be there (underlined)
2.has to be a single cell formula

Hope someone could help me out! Thanks in advance.
 
Richmondudeus

Firstly, Welcome to the Chandoo.org Forums

If the decimal always has a 0 after it I'd use:
=SUBSTITUTE(A1,".0",".")

Otherwise:
=LEFT(A1,FIND(".",A1))&RIGHT(A1,LEN(A1)-FIND(".",A1)-1)
 
Excelent and thanks for the quick reply back.
Substitute works fine except i am still losing the 0 at the end of 4.170. Could that be avoided or will excel always round it off?
 
Set the cell to have 3 digits
upload_2014-10-1_23-16-34.png

But the cells with A in them are text and that won't work
 
Hi Rich ,

If you have data of various decimal lengths , try this :

=TEXT(SUBSTITUTE(A1,".0","."),"0." & REPT("0",LEN(A1)-FIND(".",A1)-1))

Narayan
 
Back
Top