Number formatting query

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,922
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table of values, some to 2.dp, some 1.dp and some whole numbers only.

How can I format this table to show only show the number of dp that the number is? E.g.

Current table values:
Code:
1.25
2.50
3.75
5.00
Desired look:
Code:
1.25
2.5
3.75
5
I don't want a macro or event trigger solution; is there a way to force the cell formatting to adjust for this?

Thank you in advance,
Jack
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
James - General almost works, but I have negative numbers shown as red and general stops this showing.

Andrew - yes, it shows the decimal point with your suggestion when I don't want that to happen for whole numbers.

Thank you both, I think I'll have to retain it showing 2dp across all numbers - always a trade off!

Best,
Jack
 
Upvote 0
If you want negatives in red with the General format use:

General;[Red]-General

Personally, I think decimals should be aligned because it makes it easier to add up the numbers. But I'm an accountant so others may disagree.
 
Upvote 0
Perfect, thanks HRIS and Andrew,

Andrew understand exactly what you mean, but this is for a accrual issue we have over free-days that is credited back to us for work we do.. and I got formuale to do the adding up for me! It's just about layout and presentation and ease of readibility.

Much appreciated, thanks again,
Jack
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top