Solved

Remove decimals from a number and return in specific format

Posted on 2014-09-23
3
99 Views
Last Modified: 2014-09-23
I need to take the values in a column that contains numbers with and without decimals and return them in the following format:

Cell Value:         Result Needed: (zero filled on the left, four characters total)
1.8                        0180
2                           0200
.25                        0025
0
Comment
Question by:BEBaldauf
3 Comments
 
LVL 32

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 40339465
Assuming values in column A, in column B enter formula:

=A1*100

Then format with custom format "0000".

Or if not needed for onward calculations, you can use:

=TEXT(A1*100,"0000")

This latter option has no need for custom format.

Thanks
Rob H
0
 
LVL 7

Expert Comment

by:Robby Swartenbroekx
ID: 40339469
make in column B a formula =TRUNC(A1*100;0) and make the view 0000 instead of 0
0
 

Author Closing Comment

by:BEBaldauf
ID: 40339484
Thanks Rob!  The latter option you provided is perfect for the concatenation I'm trying to kluge together!
appreciate your simple, quick solution!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now