Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
solving for a sum | Excel Worksheet Functions | |||
error message - no clue what it is about | Excel Discussion (Misc queries) | |||
SUMPRODUCT clue needed | Excel Discussion (Misc queries) | |||
Not a clue of which function to use! | Excel Discussion (Misc queries) | |||
I have not got a clue | Excel Discussion (Misc queries) |