+ Reply to Thread
Results 1 to 16 of 16

Conditional Formatting for Whole Numbers

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Conditional Formatting for Whole Numbers

    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!!

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Conditional Formatting for Whole Numbers

    If your range was from a1:z1, select those cells and use this as the CF formula:

    =a1=int(a1)

    - Moo

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Conditional Formatting for Whole Numbers

    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 icon below the post.

  4. #4
    Registered User
    Join Date
    12-05-2012
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Formatting for Whole Numbers

    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!!!

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional Formatting for Whole Numbers

    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

  6. #6
    Registered User
    Join Date
    12-05-2012
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Formatting for Whole Numbers

    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?

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional Formatting for Whole Numbers

    Check out this sample.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-05-2012
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Formatting for Whole Numbers

    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?

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional Formatting for Whole Numbers

    Quote Originally Posted by Majella View Post
    Does the fact that the numbers in the cells were arrived at through a formula have any bearing on this new formula
    No, the formula should not affect the CF. Do you want to post a sample where maybe we can spot something?

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Conditional Formatting for Whole Numbers

    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

  11. #11
    Registered User
    Join Date
    12-05-2012
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Formatting for Whole Numbers

    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
    Attached Files Attached Files
    Last edited by Majella; 12-05-2012 at 08:53 PM.

  12. #12
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Conditional Formatting for Whole Numbers

    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

  13. #13
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional Formatting for Whole Numbers

    First thing, clear all the formats you currently have then follow the update to post #5

  14. #14
    Registered User
    Join Date
    12-05-2012
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Conditional Formatting for Whole Numbers

    THANK YOU!!!! So sorry, it became obvious once I realized A1 was empty!! Thanks for your help everyone!!!

  15. #15
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Conditional Formatting for Whole Numbers

    You're welcome, Majella. Glad we could help.

    - Moo, et al.

  16. #16
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Conditional Formatting for Whole Numbers

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1