Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Brad
 
Posts: n/a
Default Still need help on outstanding question

Posted last night - Subject "counting occurances" - What I'm trying to do to
count how many time "Car 1" will race "Car 2" , "Car 3", "Car 4", in about 70
different races.

Thanks in advance for helping!!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick
 
Posts: n/a
Default Still need help on outstanding question

Brad,

You could use a User-Defined-Function. Copy the code below into a codemodule in your workbook.
Then, with your race matrix in cells A1:E83, and the numbers 1 through 25 in I1:AG1, and 1 throough
25 in H2:H26, enter this formula into cell I2:

=Races($A$1:$E$83,I$1,$H2)

and copy to I2:AG26

HTH,
Bernie
MS Excel MVP

Function Races(Sched As Range, Car1 As Range, Car2 As Range) As Variant
Dim myRow As Range

Races = 0

If Car1.Value = Car2.Value Then
Races = ""
Exit Function
End If

For Each myRow In Sched.Rows
If Application.CountIf(myRow, Car1.Value) = 1 And _
Application.CountIf(myRow, Car2.Value) = 1 Then
Races = Races + 1
End If
Next myRow

End Function

"Brad" wrote in message
...
Posted last night - Subject "counting occurances" - What I'm trying to do to
count how many time "Car 1" will race "Car 2" , "Car 3", "Car 4", in about 70
different races.

Thanks in advance for helping!!



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
Pivot table question gary Excel Discussion (Misc queries) 1 January 10th 06 06:25 PM
Follow-Up (Clarification) to MIN question Odawg Excel Discussion (Misc queries) 4 October 20th 05 04:04 AM
Benefits many people - Question ebgehringer Excel Discussion (Misc queries) 0 October 7th 05 09:22 PM
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM


All times are GMT +1. The time now is 08:52 PM.

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"