#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default 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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Sudoku ernie Excel Discussion (Misc queries) 1 April 14th 10 04:45 AM
Solving Sudoku with EXCEL LynnI via OfficeKB.com Excel Worksheet Functions 4 January 29th 08 03:40 AM
Sudoku hints Rob Excel Worksheet Functions 3 October 28th 06 06:36 PM
Sudoku Danny Lewis Excel Discussion (Misc queries) 1 August 1st 06 01:40 PM
Sudoku Jonathan Cooper Excel Discussion (Misc queries) 2 January 30th 06 10:31 PM


All times are GMT +1. The time now is 04:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"