Zeros after the decimal

V

Vicki J.

I need help with a formula. I need to format a column of cells so that if
the number in a cell has a value after the decimal place (e.g.: 6.5), it
displays the value (e.g: 6.5 -- no rounding up or down), BUT if there are
only zeroes after the decimal place (e.g.: 6.0), the decimal and zeros are
removed so that only the integer (e.g: 6) is showing.

The numbers in the column will vary - some will have a value after the
decimal, some will not. They are also added up and used in other formulas.

Any help is appreciated. I've tried to search the formulas but can't see
anything that would work.
 
D

Dave Peterson

You can't do it through formatting.

If you change your requirements (allow the decimal point on whole numbers), you
could use a custom format of:

#.#
or
#.##
or
#.###
(or as many digits after the decimal place as you like)
 
D

Dave Peterson

Or just plain old General????

I was answering a question that wasn't asked! I assumed that the OP wanted a
fixed number of decimal places.



Rick Rothstein (MVP - VB) said:
What about this Custom Format?

[=0]0;General

Rick

Dave Peterson said:
You can't do it through formatting.

If you change your requirements (allow the decimal point on whole
numbers), you
could use a custom format of:

#.#
or
#.##
or
#.###
(or as many digits after the decimal place as you like)
 
R

Rick Rothstein \(MVP - VB\)

General by itself... yeah, that will work too.<g> I don't know what I was
thinking either. For some reason, I thought I was going to need a multi-part
pattern, which I had constructed, then I started to simplify it and never
gave a moment's thought to General by itself. Isn't it amazing the blind
spots we sometimes encounter?

Rick


Dave Peterson said:
Or just plain old General????

I was answering a question that wasn't asked! I assumed that the OP
wanted a
fixed number of decimal places.



Rick Rothstein (MVP - VB) said:
What about this Custom Format?

[=0]0;General

Rick

Dave Peterson said:
You can't do it through formatting.

If you change your requirements (allow the decimal point on whole
numbers), you
could use a custom format of:

#.#
or
#.##
or
#.###
(or as many digits after the decimal place as you like)


Vicki J. wrote:

I need help with a formula. I need to format a column of cells so
that
if
the number in a cell has a value after the decimal place (e.g.: 6.5),
it
displays the value (e.g: 6.5 -- no rounding up or down), BUT if there
are
only zeroes after the decimal place (e.g.: 6.0), the decimal and zeros
are
removed so that only the integer (e.g: 6) is showing.

The numbers in the column will vary - some will have a value after the
decimal, some will not. They are also added up and used in other
formulas.

Any help is appreciated. I've tried to search the formulas but can't
see
anything that would work.
 
D

Dave Peterson

I have no idea about what you write <vvbg>.

Rick Rothstein (MVP - VB) said:
General by itself... yeah, that will work too.<g> I don't know what I was
thinking either. For some reason, I thought I was going to need a multi-part
pattern, which I had constructed, then I started to simplify it and never
gave a moment's thought to General by itself. Isn't it amazing the blind
spots we sometimes encounter?

Rick

Dave Peterson said:
Or just plain old General????

I was answering a question that wasn't asked! I assumed that the OP
wanted a
fixed number of decimal places.



Rick Rothstein (MVP - VB) said:
What about this Custom Format?

[=0]0;General

Rick

You can't do it through formatting.

If you change your requirements (allow the decimal point on whole
numbers), you
could use a custom format of:

#.#
or
#.##
or
#.###
(or as many digits after the decimal place as you like)


Vicki J. wrote:

I need help with a formula. I need to format a column of cells so
that
if
the number in a cell has a value after the decimal place (e.g.: 6.5),
it
displays the value (e.g: 6.5 -- no rounding up or down), BUT if there
are
only zeroes after the decimal place (e.g.: 6.0), the decimal and zeros
are
removed so that only the integer (e.g: 6) is showing.

The numbers in the column will vary - some will have a value after the
decimal, some will not. They are also added up and used in other
formulas.

Any help is appreciated. I've tried to search the formulas but can't
see
anything that would work.
 
R

Rick Rothstein \(MVP - VB\)

Of course, I didn't mean **you** when I said we. <g>

Rick


Dave Peterson said:
I have no idea about what you write <vvbg>.

Rick Rothstein (MVP - VB) said:
General by itself... yeah, that will work too.<g> I don't know what I was
thinking either. For some reason, I thought I was going to need a
multi-part
pattern, which I had constructed, then I started to simplify it and never
gave a moment's thought to General by itself. Isn't it amazing the blind
spots we sometimes encounter?

Rick

Dave Peterson said:
Or just plain old General????

I was answering a question that wasn't asked! I assumed that the OP
wanted a
fixed number of decimal places.



:

What about this Custom Format?

[=0]0;General

Rick

You can't do it through formatting.

If you change your requirements (allow the decimal point on whole
numbers), you
could use a custom format of:

#.#
or
#.##
or
#.###
(or as many digits after the decimal place as you like)


Vicki J. wrote:

I need help with a formula. I need to format a column of cells so
that
if
the number in a cell has a value after the decimal place (e.g.:
6.5),
it
displays the value (e.g: 6.5 -- no rounding up or down), BUT if
there
are
only zeroes after the decimal place (e.g.: 6.0), the decimal and
zeros
are
removed so that only the integer (e.g: 6) is showing.

The numbers in the column will vary - some will have a value after
the
decimal, some will not. They are also added up and used in other
formulas.

Any help is appreciated. I've tried to search the formulas but
can't
see
anything that would work.
 
V

Vicki J.

Thank you very much. I guess I was trying to complicate it -- I never even
thought of General. I kept trying to find a formula.

Rick Rothstein (MVP - VB) said:
Of course, I didn't mean **you** when I said we. <g>

Rick


Dave Peterson said:
I have no idea about what you write <vvbg>.

Rick Rothstein (MVP - VB) said:
General by itself... yeah, that will work too.<g> I don't know what I was
thinking either. For some reason, I thought I was going to need a
multi-part
pattern, which I had constructed, then I started to simplify it and never
gave a moment's thought to General by itself. Isn't it amazing the blind
spots we sometimes encounter?

Rick

Or just plain old General????

I was answering a question that wasn't asked! I assumed that the OP
wanted a
fixed number of decimal places.



:

What about this Custom Format?

[=0]0;General

Rick

You can't do it through formatting.

If you change your requirements (allow the decimal point on whole
numbers), you
could use a custom format of:

#.#
or
#.##
or
#.###
(or as many digits after the decimal place as you like)


Vicki J. wrote:

I need help with a formula. I need to format a column of cells so
that
if
the number in a cell has a value after the decimal place (e.g.:
6.5),
it
displays the value (e.g: 6.5 -- no rounding up or down), BUT if
there
are
only zeroes after the decimal place (e.g.: 6.0), the decimal and
zeros
are
removed so that only the integer (e.g: 6) is showing.

The numbers in the column will vary - some will have a value after
the
decimal, some will not. They are also added up and used in other
formulas.

Any help is appreciated. I've tried to search the formulas but
can't
see
anything that would work.
 

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