I want to execute one of five different formulas depending on the value of a given cell which would be between 1 and 5. Can someone point me in the right direction?
thanks in advance
I want to execute one of five different formulas depending on the value of a given cell which would be between 1 and 5. Can someone point me in the right direction?
thanks in advance
Try
=IF(M1=1,formula1,IF(M1=2,formula2, etc.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
A regular If,Then statement might be your best bet but if you were looking to create your own Function it might look something like this:
Function VBAPost(Value)
If Value = 1 Then
VBAPost = 'Formula #1 here
ElseIf Value = 2 Then
VBAPost = 'Formula #2 here
ElseIf Value = 3 Then
VBAPost = 'Formula #3 here
ElseIf Value = 4 Then
VBAPost = 'Formula #4 here
ElseIf Value = 5 Then
VBAPost = 'Formula #5 here
End If
End Function
If you're not comfortable enough writing in VBA then your best bet would be to use the prepackaged IF() function as xld suggested.
Thanks, got it