Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot table question | Excel Discussion (Misc queries) | |||
Follow-Up (Clarification) to MIN question | Excel Discussion (Misc queries) | |||
Benefits many people - Question | Excel Discussion (Misc queries) | |||
How do I find and replace a question mark in Excel? | Excel Discussion (Misc queries) | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions |