+ Reply to Thread
Results 1 to 4 of 4

If Statement Logical Statements

  1. #1
    Registered User
    Join Date
    06-14-2007
    Posts
    2

    If Statement Logical Statements

    Quick question.. Anyone know if there's a way to set an If statement to check to see if a number is an integer?

    Rather than try to explain in prose, let me give a simple example formula. What I'm trying to do is basically this: =if(A1/B$5$=[Integer],1,0)

    Seems like there should be a way to do it, but the arithmetic formulas (ABS, INT) are designed to create integers, not check for them.

    Thoughts??

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    How about?

    =if(A1/B$5$=INT(A1/B$5$),1,0)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    OR:

    =If(MOD(A1/B$5,1)=0,1,0)

    or just simpley

    =--(MOD(A1/B$5,1)=0)

  4. #4
    Registered User
    Join Date
    06-14-2007
    Posts
    2
    Yup... Should work fine. Probably should have thought of that myself.

    Thanks for the help.

+ 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