• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some help with Excel. How do I do a True/False statement to see if a number is whole?

Swanny

Diamond Member
Hello all,

I'm doing a little experiment with prime numbers and where you might find twin primes. Anyway, I just started this afternoon. I'm doing everything in an Excel spreadsheet, but I'm stuck now.

All I need to do is have it tell me (True/False style) if the number in a cell is a whole number. For the life of me I can't figure out any way to do it. Can someone help me out with a command that will do this?

Alternately, if I could have it tell me directly if a number is prime that'd be great too. I'm doing it this way because I couldn't find a prime command either.


Thanks,
Swan

 
Modulus will return the remainder in a division operation. For example, 6 mod 4 is 2. (6 divided by 4 is 1, remainder 2).

In msot programming languages, you use the modulus operator like this:

answer = 6 % 4;

and answer will now be 2.

I've never done in in excel, but I'd imagine it's the same. If you want to see if number's divide equally, jsut check to see if the modulus is 0.
 
Back
Top