I have a spreadsheet that contains whole numbers and decimals. How do I use conditional formatting to highlight the cells with whole numbers? Help please!!
I have a spreadsheet that contains whole numbers and decimals. How do I use conditional formatting to highlight the cells with whole numbers? Help please!!
If your range was from a1:z1, select those cells and use this as the CF formula:
=a1=int(a1)
- Moo
Hi,
One way would be to test whether a cell's number equals the cell's integer. i.e. =A1=INT(A1)
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Thank you but I'm a real beginner here. Can you please break it down even further. How do I input the formula? I have highlighted the group of cells, now what? Your help is much appreciated - thanks!!!
Based on what you were given from above...
Conditional Formatting
- Highlight applicable range >> $B$2:$I$90
- Home Tab >> Styles >> Conditional Formatting
- New Rule >> Use a formula to determine which cells to format
- Edit the Rule Description: Format values where this formula is true: =B2=INT(B2)
- Format… [Number, Font, Border, Fill]
- OK >> OK
Last edited by jeffreybrown; 12-05-2012 at 08:55 PM.
HTH
Regards, Jeff
Thanks Jeff, I just followed those steps and for some reason it has highlighted cells with both whole numbers and decimals and left blank cells with both whole numbers and decimals...any advice?
Check out this sample.
Does the fact that the numbers in the cells were arrived at through a formula have any bearing on this new formula I'm trying to implement?
all formulas (CF and otherwise) reference the answer in the cell, not the "contents" of the cell, so no, it should not affect it
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
here's the spreadsheet I'm working on - thanks for your help
I want to highlight the cells between B2 -I90 that contain whole numbers
Last edited by Majella; 12-05-2012 at 08:53 PM.
Delete the formatting rules you have and create a new one using this formula:
=B2=INT(B2)
- Moo
* Make sure B2:I90 are selected before you create the CF
First thing, clear all the formats you currently have then follow the update to post #5
THANK YOU!!!! So sorry, it became obvious once I realized A1 was empty!! Thanks for your help everyone!!!![]()
You're welcome, Majella. Glad we could help.
- Moo, et al.![]()
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks