• 100% Satisfaction Guarantee
John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience:  Bachelor of Science - Engineering Consultant
53785
Type Your Microsoft Office Question Here...
John D is online now

# how can i remove trailing zeroes after a decimals but keep

how can i remove trailing zeroes after a decimals but keep other numbers after a decimal. Excel 2010.

e.g
10.0 --> 10
12.6---> 12.6

Ok here is the formula for that

=IF(RIGHT(A2,2)=".0",LEFT(A2,LEN(A2)-2),A2)

Place the formula in cell B2 to convert the code in A2

Hope this helps. Let me know if you have any questions

John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience: Bachelor of Science - Engineering Consultant
Customer: replied 5 years ago.

great. how about trailing zeroes as well. So I don' t want 010.3. I just want 10.3. Furthermore, if there are both trailing and leading zeroes remove, e.g. 010.0 will be 10.

Thanks.

As you know these different requirements which will take some time. Will see what I can do when I have some time

John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience: Bachelor of Science - Engineering Consultant
Customer: replied 5 years ago.

if you can't help within the next hour, I might have to ask another expert and click 'not satisfied.' i won't ofcourse leave a bad review.... if you do it though soon, i will rate again.........

Yes I can start on it as soon as I finish what I am on now. Should have it ready in 30 to 45 mins

Do you want all three conditions combined in one formula, or three separate formulas

Customer: replied 5 years ago.

probably all in one formula, though for each file I won't need each condition, but at least might require all three. is it okay to use it on a file even of all three conditions would be utilized?

Yes you can use the combined formula in files where there is only or two or three conditions

Here is the combined formula for B2 which converts the code in A2

=IF(RIGHT(IF(LEFT(A2,1)="0",RIGHT(A2,LEN(A2)-1),A2),2)=".0",LEFT(IF(LEFT(A2,1)="0",RIGHT(A2,LEN(A2)-1),A2),LEN(IF(LEFT(A2,1)="0",RIGHT(A2,LEN(A2)-1),A2))-2),IF(LEFT(A2,1)="0",RIGHT(A2,LEN(A2)-1),A2))

John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience: Bachelor of Science - Engineering Consultant
Customer: replied 5 years ago.

that didn't work.........here is the file.............the item is in column D. I changed your formula to C.

Ok I can only look at the file and see what's going on later this afternoon as I really have some deadlines to meet. So I will opt out in order not to cause any delay in your project. I have no problem if you want other experts to use my formula.

If you don't get any response after a while let me know and I will try to help

Hi, I’m a moderator for this topic. It seems the professional has left this conversation. This happens occasionally, and it's usually because the professional thinks that someone else might be a better match for your question. I've been working hard to find a new professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.

I wonder whether you're OK with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, feel free to let me know and I will cancel this question for you. Thank you!

Customer: replied 5 years ago.

sorry, please DON't CANCEL. I will try to get a response from the same expert...

Ok I just had a chance to check your last file. The reason the formula in D was not working is because you have not copied the formula in D correctly. Here, I fixed the formulas and extended it down to the last row

http://www.filesharesite.com/files/201209/1347073203DG_LD_FINAL_NEW2.xlsx

Please remember to rate the solution as the last additional modification that you have requested lately has not been rated yet

Thanks

John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience: Bachelor of Science - Engineering Consultant
Customer: replied 5 years ago.

i'll be glad to rate you positively. can you just correct the first row? There is a leading zero. Probably because this is the only two digit value.

Thanks

Allowing for the extra 0 in the same formula will require a totally different and rather complex formula. Instead I will add an extra column with a separate step to remove the extra leading 0

On it now..

.

Ok done. Took over half an hour to do that change mainly because the file was bloated and kept hanging. Then I decided to fix the file before applying the new formulas.

http://www.filesharesite.com/files/201209/1347117961DG_LD_FINAL_NEW2a.xlsx

Customer: replied 5 years ago.

For some reason, the formula you placed in this file is skipping and looking at the row above, but this only starts after row 11. Please see file and help!

I am a bit confused as I have created about 10 different formulas and I can't remember what these particular formulas are supposed to do. And also the file does not look familiar at all

Did these number formats exist in the file when the formulas were created?

If so, could you send me back the same file which I created these formulas on

If not then the formulas that I created should work fully on the original file, in which case a new formula needs to be created to cover the number formats that were not there before. In that case I suggest that you post this in a new question as I am going to be really busy in the coming few days

Thank you