D
danpt
Does Excel has a formula to check if an integer is a prime number or not?
Thank you
Thank you
Every odd number isn't prime, the correct definition is that a
prime number has 2 (and only 2) distinct natural number
divisors.
"muddan madhu" wrote:
No.
Thanks to Chip Pearson for providing this formula
________________
The formula below will test the number in cell C8 and return the word prime
if it is prime or the string not prime if the number is not prime.
=IF(OR(C8=1,C8=2,C8=3),"prime",
IF(AND((MOD(C8,ROW(INDIRECT("2:"&C8-1)))<>0)),"prime","not prime"))
This is an array formula, so you must press CTRL SHIFT ENTER rather than
just ENTER when you first enter the formula and whenever you edit it later.
If you do this properly, Excel will display the formula enclosed in curly
braces { }.
Does Excel has a formula to check if an integer is a prime number or not?
Thank you