MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Not even sure what to call this one

Posted by R.Brayton on June 27, 2001 11:48 PM

I hope I can discribe this question poperly.
I have a datbase of numbers. let's say 1-30
the numbers are listed horizontally in rows.
each row consists of 4 cells. 1 number in each cell.
Each row increments the row by one number. Like in a lottery. i.e. 1,2,3,4 - 1,2,3,5 - 1,2,3,6 thru 27,28,29,30. My question is do I setup a formula that will find the combinations I defined. Such as, each number is seperated by 1 or 2 numbers? i.e 2,4,6,8, or
1,4,7,10 or 5,10,15,20. Then move them to a different sheet. And if anyone can answer that much I also need to know how to do it if all numbers are odd. all are even, and all are prime numbers. I have a feeling this is a tall order, involving many aspects of the program, but I have to start somewhere. So sincere thanks to anyone who might tackle this one.

Posted by cpod on June 28, 2001 7:43 AM

If your numbers are in columns A-D and amount of seperation is in H2 then this will return 1 for true and 0 for false:


You can use the IsOdd and IsEven functions to set up a similar formula for the instance. And for primes you can have a list somewhere in your workbook of the primes between 1 - 30 and use the Match function for that formula.