![]() |
Zeros after the decimal
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. |
Zeros after the decimal
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. -- Dave Peterson |
Zeros after the decimal
What about this Custom Format?
[=0]0;General Rick "Dave Peterson" wrote in message ... 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. -- Dave Peterson |
Zeros after the decimal
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)" wrote: What about this Custom Format? [=0]0;General Rick "Dave Peterson" wrote in message ... 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. -- Dave Peterson -- Dave Peterson |
Zeros after the decimal
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" wrote in message ... 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)" wrote: What about this Custom Format? [=0]0;General Rick "Dave Peterson" wrote in message ... 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. -- Dave Peterson -- Dave Peterson |
Zeros after the decimal
I have no idea about what you write <vvbg.
"Rick Rothstein (MVP - VB)" wrote: 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" wrote in message ... 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)" wrote: What about this Custom Format? [=0]0;General Rick "Dave Peterson" wrote in message ... 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. -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Zeros after the decimal
Of course, I didn't mean **you** when I said we. <g
Rick "Dave Peterson" wrote in message ... I have no idea about what you write <vvbg. "Rick Rothstein (MVP - VB)" wrote: 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" wrote in message ... 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)" wrote: What about this Custom Format? [=0]0;General Rick "Dave Peterson" wrote in message ... 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. -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Zeros after the decimal
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)" wrote: Of course, I didn't mean **you** when I said we. <g Rick "Dave Peterson" wrote in message ... I have no idea about what you write <vvbg. "Rick Rothstein (MVP - VB)" wrote: 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" wrote in message ... 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)" wrote: What about this Custom Format? [=0]0;General Rick "Dave Peterson" wrote in message ... 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. -- Dave Peterson -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 08:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com