cell that accepts a whole number or five place deciaml

C

crck_whr

Is there a way to format a cell so that if you enter a whole number it stays
the way it was entered byt if you enter a decimal it gives the number five
decimal places? I have tried using general cell formatiing but this drops
zeros from the end and I need them to be displayed.
 
F

Frank Kabel

Hi
AFAIK there's no such format. This would either require VBA (using an event
procedure) or a separate cell with a helper formula (which would be difficult
for trainling zeros though)
 
K

K.S.Warrier

Hi,
Suppose you have the number with decimals in cell A1.Then in B1 ,first
format the cell to 5 decimals & then,write
=if(mod(A1,1)=0,int(A1),A1) which will give you the desired result.This
may be repeated in other cells also.
Thank you,
K.S.Warrier
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top