Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Need help with custom function that deals with times
I made a tournament elimination chart in Excel that is totally automated.
Everything is working except for the custom function I am trying to create to change the times for the start of each event. Any help that anyone can give me with the correct way to write this function would be greatly appreciated. Here is the Function that I have created. The error code I get is: An END IF statement mus have a corresponding IF statement. All of the DIM statements are "As Variant" Function Evtime(Time1, Time2) Gameint = Index!M20 Lunchbk = Index!M21 Addtm = Index!M22 Pmstart = Index!M23 Gametm = AT5 Exp1 = (Time1 + Gametm + Gameint) Exp2 = (Lunchbk - Gametm) Exp3 = (Time2 + Gametm + Gameint) Exp4 = (Time1 + Gametm + Gameint + Addtm) If Exp1 < Exp2 Then Result1 = Exp1 Else Result1 = Pmstart If Exp1 Exp2 Then Result1 = Exp1 Else Result1 = Pmstart If Exp1 = Exp3 Then Evtime = Result1 Else Evtime = Exp4 End IF End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Custom Function | Excel Discussion (Misc queries) | |||
UDF help please | Excel Discussion (Misc queries) | |||
Automatically up date time in a cell | Excel Discussion (Misc queries) | |||
Whats the function to count the total times a word is displayed | Excel Discussion (Misc queries) | |||
How can use IF function more than 7 times in a cell | Excel Worksheet Functions |