Quantcast
Channel: Format a number with optional decimal places in Excel - Super User
Browsing latest articles
Browse All 15 View Live

Answer by Mr.J for Format a number with optional decimal places in Excel

My Answer removes the decimal point AND Removes 0 valuein conditional formatting write:General;#;;@This should do the trick.

View Article



Answer by lookingforsame for Format a number with optional decimal places in...

This seems to be the simplest way to have a Decimal shown when there are fractional numbers - and No Decimal shown for whole numbers:=TEXT(ROUND(Base_Number,Max_Decimal_Places),"general")or with cell...

View Article

Answer by Wayne Hoff for Format a number with optional decimal places in Excel

This doesn't have to be quite so complicated - it can be done exclusively with Conditional Formatting. I have Excel 2010, so this may not work for earlier versions.Format the cells to be General. The...

View Article

Answer by user228931 for Format a number with optional decimal places in Excel

B1=IF(ROUND(A1,2)=INT(A1),TEXT(A1,"0"),TEXT(A1,"0.##"))C1=IF(ROUND(B1,2)=INT(B1),TEXT(B1,"0"),TEXT(B1,"0.##"))No more orphan decimal points.

View Article

Answer by Ross for Format a number with optional decimal places in Excel

Alternatively, you can solve the "optional" decimal point problem using the following solution:Number Format: General;[Red](General)This will add the decimal place and fractional value accordingly,...

View Article


Answer by Joshua Seigler for Format a number with optional decimal places in...

Remember that in Reporting Services, you can write an expression for the number formatting, too. In my situation, I...

View Article

Answer by John for Format a number with optional decimal places in Excel

Here's one method using conditional formatting.Right click your cell, choose "Format Cell"Select "Custom"Enter "0.####" (add more or fewer #s to control the maximum number of decimal places)Click...

View Article

Answer by viet for Format a number with optional decimal places in Excel

Apply Conditional Formatting for non-decimal numbers.For example, A1 is the target cell.Format A1 as "###,###.00". This will be used for decimal number.Define Conditional Formatting for non-decimal...

View Article


Answer by Fred for Format a number with optional decimal places in Excel

Format cell as 'General' then under data validation restrict values to decimals

View Article


Answer by Droj for Format a number with optional decimal places in Excel

I ran into this recently in Excel 2007 and just ended up using the 'TRUNC' function in the value cells: value =TRUNC(B5,1) 0 0 5 5 5.4 5.4 65.43 65.4765.432 765.4Worked exactly the way I wanted it to...

View Article

Answer by John for Format a number with optional decimal places in Excel

Using the Round function to provide significant figures. This does not change the number of decimal places displayed however. Just format the cell with general number format...

View Article

Answer by Jamie Henderson for Format a number with optional decimal places in...

Further to Luke's great answer above here is a variation based on his work. I didn't want to have a zero in the cell if there was no value. Leave your cell format as general and used this...

View Article

Answer by Robert Mearns for Format a number with optional decimal places in...

Excel custom formats can provide a partial answerCustom formats for numbers in Excel are entered in this format:positive number format;negative number format;zero format;text formatOne format that...

View Article


Answer by Luke for Format a number with optional decimal places in Excel

Are you / your users inputting values directly in the cells, or are they being populated by a formula or a macro?If the cells are not being populated directly by a human, you could store the calculated...

View Article

Format a number with optional decimal places in Excel

I have numbers in cells in Excel. I want the numbers formatted so that if they have decimal places they show to a maximum of two, and if they have no decimal places it doesn't show any.For example. 15...

View Article

Browsing latest articles
Browse All 15 View Live




Latest Images