View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Zone Zone is offline
external usenet poster
 
Posts: 269
Default Code to replace Formula

Corey, Display the Excel worksheet. Press Alt-F11 to display the code
editor. Select Insert from the menubar, then Module. Copy this code
and paste it there.
Function BigIf()
If [c5] < "Non U/G" And [c5] < "Delta" And [c7] [v2] And [c7] <
[w2] And [c8] [w2] Then
BigIf = "0.75"
ElseIf [c5] = "Delta" And [c7] [v2] And [c7] < [w2] And [c8]
[w2] Then
BigIf = "0.5"
ElseIf [c5] < "Non U/G" And [c5] < "Delta" And [c7] < [v2] And
[c8] < [v2] Then
BigIf = "1.5"
ElseIf [c5] = "Delta" And [c7] < [v2] And [c8] < [v2] Then
BigIf = "1"
ElseIf [c5] < "Non U/G" And [c5] < "Delta" And [c7] < [v2] And
[c8] = [w2] Then
BigIf = "0.75"
ElseIf [c5] = "Delta" And [c7] < [v2] And [c8] = [w2] Then
BigIf = "0.5"
ElseIf [c5] < "Non U/G" And [c5] < "Delta" And [c7] < [v2] And
[c8] [v2] And [c8] <= [w2] Then
BigIf = "0.75"
ElseIf [c7] < [v2] And [c8] [v2] And [c8] [v2] And [c8] <= [w2]
Then
BigIf = "0.05"
Else
BigIf = "0"
End If
End Function

Press Alt-F11 to return to the worksheet. In the cell where you want
to call this function, type BigIf()

If I haven't missed anything (whew) this should work. Check the code
for obvious errors! James

Corey wrote:
=IF(AND(C5<"Non
U/G",C5<"Delta",C7V2,C7<W2,C8W2),"0.75",IF(AND(C5 ="Delta",C7V2,C7<W2,C8W2),"0.5",IF(AND(C5<"N on
U/G",C5<"Delta",C7<V2,C8<V2),"1.5",IF(AND(,C5="Delt a",C7<V2,C8<V2),"1",IF(AND(C5<"Non
U/G",C5<"Delta",C7<V2,C8=W2),"0.75",IF(AND(C5="Del ta",C7<V2,C8=W2),"0.5",IF(AND(C5<"Non
U/G",C5<"Delta",C7<V2,C8V2,C8<=W2),"0.75",IF(AND(C 7<V2,C8V2,C8<=W2),"0.5","0"))))))))

I think i am at the end of the fomula limit.
How to i enter this as code?


--
Regards

Corey