fbpx
Search
Close this search box.

All articles with 'prime numbers' Tag

Array formula to check if a number is prime [just for fun]

Published on May 29, 2009 in Learn Excel

I am math-geek-wannabe, if there ever is such a category. During my 3rd year of graduation I went and purchased the volume 2 of Donald Knuth’s Art of Computer Programming and thus began my love with all things random and prime. I never really became the math-geek I always wanted to, instead I became an insurance expert with tons of passion for data and visualization. But when I get a chance to poke with randomness or numbers, I always lap it up with joy. And that brings us to an interesting array formula trick to check if a number is prime or not.

(assuming the number is in the cell B2) type the below formula and

=IF(MIN(MOD($B$5,ROW(INDIRECT(“2:”&INT(SQRT($B$5))))))=0,”not prime”,”prime”)

hit ctrl+shift+enter and bingo, it tells you if the number is prime or not. Read on to find how it works

Continue »

Excel Links of the Week – PHD’s new tag line [Nov 24]

Published on Nov 24, 2008 in blogging, excel links

This is probably the 100th time I have changed this site’s tag line. So, it may not be a great news to you. But again, I need to say out this loud so that you, my dear reader, will know what this blog is going to stand for: Excel Tips, Charting Ideas and Visualization Oomph. […]

Continue »