Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Solving the 'CLUE' Murder

I think the best way to express my problem is to reference the Clue game.
You have one list of possible murderers, one list of possible rooms and one
list of possible murder weapons. How do I write a function to solve for all
possible answers?

Column A Column B Column C
Plum Kitchen Candlestick
Green Dining Room Gun
Violet Living Room Knife
Mustard Library Rope

I could write out multiple functions, (A1,"in the",B1,"with the",C1);
(A1,"in the",B2,"with the",C1); (A1,"in the",B3,"with the",C1) and so on.
But is there an easier way to find all possible combinations?

Thanks for your help,
DaleFlyFisher
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Solving the 'CLUE' Murder

Run this macro:

Sub ordinate()
s = Array("Plum", "Green", "Violet", "Mustard")
t = Array("Kitchen", "Dinning Room", "Living Room", "Library")
u = Array("Candlestick", "Gun", "Knife", "Rope")
l = 1
For i = 0 To 3
For j = 0 To 3
For k = 0 To 3
Cells(l, 1).Value = s(i) & " in the " & t(j) & " with a " & u(k)
l = l + 1
Next
Next
Next
End Sub

--
Gary''s Student - gsnu200777


"DaleFlyFisher" wrote:

I think the best way to express my problem is to reference the Clue game.
You have one list of possible murderers, one list of possible rooms and one
list of possible murder weapons. How do I write a function to solve for all
possible answers?

Column A Column B Column C
Plum Kitchen Candlestick
Green Dining Room Gun
Violet Living Room Knife
Mustard Library Rope

I could write out multiple functions, (A1,"in the",B1,"with the",C1);
(A1,"in the",B2,"with the",C1); (A1,"in the",B3,"with the",C1) and so on.
But is there an easier way to find all possible combinations?

Thanks for your help,
DaleFlyFisher

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Solving the 'CLUE' Murder

Thank you "Gary"s Student".

If there are dozens of cells in each column, do I have to write out each and
every cell value in the macro? And can the results be made to appear in a
column other than Column A?

Thanks again,
DaleFlyFisher


"Gary''s Student" wrote:

Run this macro:

Sub ordinate()
s = Array("Plum", "Green", "Violet", "Mustard")
t = Array("Kitchen", "Dinning Room", "Living Room", "Library")
u = Array("Candlestick", "Gun", "Knife", "Rope")
l = 1
For i = 0 To 3
For j = 0 To 3
For k = 0 To 3
Cells(l, 1).Value = s(i) & " in the " & t(j) & " with a " & u(k)
l = l + 1
Next
Next
Next
End Sub

--
Gary''s Student - gsnu200777


"DaleFlyFisher" wrote:

I think the best way to express my problem is to reference the Clue game.
You have one list of possible murderers, one list of possible rooms and one
list of possible murder weapons. How do I write a function to solve for all
possible answers?

Column A Column B Column C
Plum Kitchen Candlestick
Green Dining Room Gun
Violet Living Room Knife
Mustard Library Rope

I could write out multiple functions, (A1,"in the",B1,"with the",C1);
(A1,"in the",B2,"with the",C1); (A1,"in the",B3,"with the",C1) and so on.
But is there an easier way to find all possible combinations?

Thanks for your help,
DaleFlyFisher

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
solving for a sum acp20770 Excel Worksheet Functions 1 December 14th 06 12:21 AM
error message - no clue what it is about smritisuman Excel Discussion (Misc queries) 1 December 7th 06 08:04 AM
SUMPRODUCT clue needed Dallman Ross Excel Discussion (Misc queries) 5 September 25th 06 12:29 PM
Not a clue of which function to use! y_not Excel Discussion (Misc queries) 1 April 11th 06 07:23 PM
I have not got a clue emailreynolds Excel Discussion (Misc queries) 1 August 25th 05 06:12 PM


All times are GMT +1. The time now is 12:30 PM.

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"