Hi,
I've created a simple function but it doesn't seem to work. Any help would be greatly appreciated.
Thanks a million!HTML Code:
Hi,
I've created a simple function but it doesn't seem to work. Any help would be greatly appreciated.
Thanks a million!HTML Code:
Last edited by concatch; 12-06-2012 at 10:22 AM.
![]()
Function getelasticity(rng As Range) As String Dim strReturn As String If rng.Value = 0 Then strReturn = "Perfectly Inelastic Demand" ElseIf rng.Value > -1 And rng.Value < 0 Then strReturn = "Inelastic Demand" ElseIf rng.Value = -1 Then strReturn = "Unit Elastic Demand" ElseIf rng.Value > -9999 And rng.Value < -1 Then strReturn = "Elastic Demand" ElseIf rng.Value < -9999 Then strReturn = "Perfectly Elastic" Else strReturn = "UNKNOWN" End If getelasticity = strReturn End Function
Last edited by JosephP; 12-06-2012 at 10:17 AM.
Josie
if at first you don't succeed try doing it the way your wife told you to
Thanks a million!!!
I do not see any error on the function
Jay,
No code tags![]()
sure there are ;-)
You need to check out If-Then-Else syntax: http://www.techonthenet.com/excel/formulas/if_then.php
and don't forget to assign the value of the string variable to your function at the end!
Edit: sorry, a bit slow.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks