ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sudoku (https://www.excelbanter.com/excel-programming/335966-sudoku.html)

Wim Rijsdijk

sudoku
 
Hello,

I am trying to make an Excel-spreadsheet, based on Sudoku puzzle.

So , cells a1 to i1 have to be filled with the numbers 1 to 9, in random
order.


a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s

1


4


6




1
2
3

5

7
8
9

2

1

2
5
9

4
6



3



7
8


3








7

1
2
3
4
5
6

8
9

4


1
3
9


7
2




4
5
6

8


5

3


7


5


1
2

4

6

8
9

6
9
7


4





1
2
3

5
6

8


7
8
9


2

6

4

1

3

5

7



8
1
2

4
6
7

8




3

5



9

9



9
8





1
2
3
4
5
6
7





As you see, a1 to i1 is only filled with 4 and 6.
In columns k to s you can see which numbers are not used, so in this example
in row 1, it is 1,2,3,5,7,8,9

The problem is, I want a formula to put on k1, with the following needs:
- check for a1 to i1 if number 1 is on it. In this example NO.
- if NO, then on k1 the number 1 has to appear
- it YES, then on k1 the number 1 has to disappear.

if((b1:j1)=1;" ";"1") is not working. What is the solution ?!?!?!?

If I have 1 formula, I can fill the other cells.

Thanks in advance, for helping me.

Greets,
Wim Rijsdijk





Wim Rijsdijk

sudoku
 
forget this one, I made a new message, without Excel-sheet
!!!!!!!!!!!!!!!!!!!!!!!!

"Wim Rijsdijk" schreef in bericht
...
Hello,

I am trying to make an Excel-spreadsheet, based on Sudoku puzzle.

So , cells a1 to i1 have to be filled with the numbers 1 to 9, in random
order.


a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s

1


4


6




1
2
3

5

7
8
9

2

1

2
5
9

4
6



3



7
8


3








7

1
2
3
4
5
6

8
9

4


1
3
9


7
2




4
5
6

8


5

3


7


5


1
2

4

6

8
9

6
9
7


4





1
2
3

5
6

8


7
8
9


2

6

4

1

3

5

7



8
1
2

4
6
7

8




3

5



9

9



9
8





1
2
3
4
5
6
7





As you see, a1 to i1 is only filled with 4 and 6.
In columns k to s you can see which numbers are not used, so in this

example
in row 1, it is 1,2,3,5,7,8,9

The problem is, I want a formula to put on k1, with the following needs:
- check for a1 to i1 if number 1 is on it. In this example NO.
- if NO, then on k1 the number 1 has to appear
- it YES, then on k1 the number 1 has to disappear.

if((b1:j1)=1;" ";"1") is not working. What is the solution ?!?!?!?

If I have 1 formula, I can fill the other cells.

Thanks in advance, for helping me.

Greets,
Wim Rijsdijk







keepITcool

sudoku
 
there's a sodoku solver
from Andy Pope...

and I've made my own...

a bit quicker AND in most cases manages
to solve 4x4 puzzles too...

mail me if interested.




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Wim Rijsdijk wrote :

forget this one, I made a new message, without Excel-sheet
!!!!!!!!!!!!!!!!!!!!!!!!

"Wim Rijsdijk" schreef in bericht
...
Hello,

I am trying to make an Excel-spreadsheet, based on Sudoku puzzle.

So , cells a1 to i1 have to be filled with the numbers 1 to 9, in
random order.


a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s

1


4


6




1
2
3

5

7
8
9

2

1

2
5
9

4
6



3



7
8


3








7

1
2
3
4
5
6

8
9

4


1
3
9


7
2




4
5
6

8


5

3


7


5


1
2

4

6

8
9

6
9
7


4





1
2
3

5
6

8


7
8
9


2

6

4

1

3

5

7



8
1
2

4
6
7

8




3

5



9

9



9
8





1
2
3
4
5
6
7





As you see, a1 to i1 is only filled with 4 and 6.
In columns k to s you can see which numbers are not used, so in this

example
in row 1, it is 1,2,3,5,7,8,9

The problem is, I want a formula to put on k1, with the following
needs: - check for a1 to i1 if number 1 is on it. In this example
NO. - if NO, then on k1 the number 1 has to appear
- it YES, then on k1 the number 1 has to disappear.

if((b1:j1)=1;" ";"1") is not working. What is the solution ?!?!?!?

If I have 1 formula, I can fill the other cells.

Thanks in advance, for helping me.

Greets,
Wim Rijsdijk





Henry[_5_]

sudoku
 
Wim,

Are you trying to make a Sudoku puzzle or to solve one?

Either way, put the numbers 1 to 9 in a string (in any order)
If the number is already used, take it out of the string.
Then choose a random position from the string
MyNum = Rand *Len(string)

Mid(string,MyNum,1)

Do your checks to see if that number is possible in that position, if it is
then use the number.

Now that the number has been used, take it out of the string

String = Left(string,Mynum-1) & Right(string,Len(string)-Mynum).

You are now left with the remaining, unused numbers to select from.

Henry


"Wim Rijsdijk" wrote in message
. ..
forget this one, I made a new message, without Excel-sheet
!!!!!!!!!!!!!!!!!!!!!!!!

"Wim Rijsdijk" schreef in bericht
...
Hello,

I am trying to make an Excel-spreadsheet, based on Sudoku puzzle.

So , cells a1 to i1 have to be filled with the numbers 1 to 9, in
random
order.


a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s

1


4


6




1
2
3

5

7
8
9

2

1

2
5
9

4
6



3



7
8


3








7

1
2
3
4
5
6

8
9

4


1
3
9


7
2




4
5
6

8


5

3


7


5


1
2

4

6

8
9

6
9
7


4





1
2
3

5
6

8


7
8
9


2

6

4

1

3

5

7



8
1
2

4
6
7

8




3

5



9

9



9
8





1
2
3
4
5
6
7





As you see, a1 to i1 is only filled with 4 and 6.
In columns k to s you can see which numbers are not used, so in this

example
in row 1, it is 1,2,3,5,7,8,9

The problem is, I want a formula to put on k1, with the following needs:
- check for a1 to i1 if number 1 is on it. In this example NO.
- if NO, then on k1 the number 1 has to appear
- it YES, then on k1 the number 1 has to disappear.

if((b1:j1)=1;" ";"1") is not working. What is the solution ?!?!?!?

If I have 1 formula, I can fill the other cells.

Thanks in advance, for helping me.

Greets,
Wim Rijsdijk










All times are GMT +1. The time now is 11:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com