Scenario
Suppose you are asked to find out number of prime numbers in an interval.
Suppose lower limit of a range is entered in cell C2 and upper limit in cell C3.
2. Click "New"
3. In "Name", type rng
4. In "Refers to: " box, enter =ROW(INDIRECT(Sheet1!$C$2&":"&Sheet1!$C$3))
5. Click OK
6. Click Close
In cell E5, enter the following formula :
Suppose you are asked to find out number of prime numbers in an interval.
Suppose lower limit of a range is entered in cell C2 and upper limit in cell C3.
Solution
1. Press CTRL + F3 to open name manager2. Click "New"
3. In "Name", type rng
4. In "Refers to: " box, enter =ROW(INDIRECT(Sheet1!$C$2&":"&Sheet1!$C$3))
5. Click OK
6. Click Close
In cell E5, enter the following formula :
Hit CTRL + SHIFT + ENTER to confirm this formula as an array formula. If done correctly, Excel will automatically place curly braces {...} around the formula.
Download the workbook
Related Post :
Generating prime numbers in an interval with Excel
Check if a number is prime with Excel
Great stuff! Thanks for posting... I love to see how things work... Also, I like to see how far you can push Excel before it breaks. I expanded the list of primes from 25 to 500, runs slow but still works.
ReplyDelete