#,###
April 26, 2009 9:21 AM
Subscribe
I need a custom number format for Excel that only gives me a decimal when I need it.
What I have: a list of numerical data from 0 to, say, 9999. I want it to display with commas (ie "1,234"). Easy enough. But some of these numbers have a .5 after, as in, "1,234.5". I want to tell Excel to display the numbers, with comma, and display the .5 only when required. I do NOT want it to use a .0 for the integers.
I can get close to what I want with the format "#,##0.#" but then the period is on every number, which is also undesirable.
There must be an easy way of doing this, but I'm tired of trying to find it. Thanks in advance!
posted by lou to computers & internet (5 comments total)
1 user marked this as a favorite
So your formula might look something like =IF(MOD(A1,1)=0,*format1*,*format2*)
I don't have excel handy at the moment, so I can't check this out and provide a complete answer, but it might give you ideas on where to start searching.
posted by chrisamiller at 9:30 AM on April 26