I am trying to highlight only those values that are whole numbers and want to 'hide' or even not show any values that are not whole numbers.
Conditional Formatting - on decimal place values?
Conditional Formatting - on decimal place values?
Is it possible to set up conditional formatting on cell values so that if the calculated value is not a whole number (e.g. 123.00) the formatting changes.
I am trying to highlight only those values that are whole numbers and want to 'hide' or even not show any values that are not whole numbers.

I am trying to highlight only those values that are whole numbers and want to 'hide' or even not show any values that are not whole numbers.
OpenOffice 3.3.0. on Vista Home Premium 64bit.
Re: Conditional Formatting - on decimal place values?
You can set the conditional formatting to use a formula
This will flag cells that contain exact integers. If the cell contents are the results of a calculation, you will want to embed the ROUND function so that rounding problems don't cause errors. For example, limiting the precision to 4 decimal places:
You can set the formatting so that cells that fail the test use a font color that matches the background, so they will appear empty.
Code: Select all
MOD(A1;1) = 0Code: Select all
MOD(ROUND(A1;4);1) = 0OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: Conditional Formatting - on decimal place values?
Just create a cell style, say "HideNumber," with the font color the same as the background color. In conditional formatting then, choose "Formula is" instead of "Cell value is," enter as the formula cell<>INT(cell) (where cell is the address of the cell you're formatting) and apply that style, and then also you can create some style for your whole numbers, and apply it with the formula cell=INT(cell). There would be some other niceties if you want to check if the cell contains a string and so forth. Note that the font color trick only hides the value in the cell; it still shows on the input line.Adendum wrote:Is it possible to set up conditional formatting on cell values so that if the calculated value is not a whole number (e.g. 123.00) the formatting changes.
I am trying to highlight only those values that are whole numbers and want to 'hide' or even not show any values that are not whole numbers.
| Edit: Too slow, but either way will work. |
Apache OpenOffice 4.1.1
Windows XP
Windows XP