LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default how do I create independent results?

Brute force and ignorance but it does it.
Extending to more cars/drivers gets very tedious.

A little more finesse anyone.




Sub assignDriver()

Dim driverName(4) As String
Dim i As Integer

'Assign driver names to array
driverName(1) = "Steve"
driverName(2) = "Mary"
driverName(3) = "Craig"
driverName(4) = "Alison"

'Write headings
Cells(1, 1) = "index"
Cells(1, 2) = "Car1"
Cells(1, 3) = "Car2"
Cells(1, 4) = "Car3"
Cells(1, 5) = "Car4"

i = 0
For driverCar1 = 1 To 4
For driverCar2 = 1 To 4
If driverCar2 < driverCar1 Then
For driverCar3 = 1 To 4
If driverCar3 < driverCar1 Then
If driverCar3 < driverCar2 Then
For driverCar4 = 1 To 4
If driverCar4 < driverCar1 Then
If driverCar4 < driverCar2 Then
If driverCar4 < driverCar3 Then
i = i + 1
Cells(i + 1, 1) = i
Cells(i + 1, 2) =
driverName(driverCar1)
Cells(i + 1, 3) =
driverName(driverCar2)
Cells(i + 1, 4) =
driverName(driverCar3)
Cells(i + 1, 5) =
driverName(driverCar4)
End If
End If
End If
Next driverCar4
End If
End If
Next driverCar3
End If
Next driverCar2
Next driverCar1
End Sub


"Mark" wrote:

I am NOT a seasoned user, so forgive me if this questions is too simple:
I have 4 cars and 4 drivers. I want Excel to fill-out the possibilities of
drivers.
1 = Steve
2 = Mary
3 = Craig
4 = Allison
If I remember from my Algebra days, there should be 24 independent results
(1x2x3x4= 24) Please Help

 
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
Create a conditional formula that results in another calculation dyrret Excel Worksheet Functions 11 March 19th 17 09:34 PM
Create a Table of Results balhal Excel Discussion (Misc queries) 0 February 19th 09 03:44 PM
Can I create a display box to see results no matter where I am in jeroamd Excel Discussion (Misc queries) 3 June 27th 06 04:20 PM
How to create independent worksheets using data in columns in a s. FTJMackey Excel Worksheet Functions 0 May 23rd 06 10:22 AM
create sheet from autofilter results umba-sr Excel Discussion (Misc queries) 1 February 21st 06 01:34 PM


All times are GMT +1. The time now is 10:59 AM.

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

About Us

"It's about Microsoft Excel"