You need to sign in to do that
Don't have an account?
Help with an IF(Begins statement with multiple values
I can't get this to work and was hoping someone can help... Any thoughts?
IF(BEGINS( Phone , "(804)"), "Richmond",
IF(BEGINS(Phone , "(757)"),"Virginia Beach - Norfolk",
IF(BEGINS(Phone , "(704):(980)"),"Raleigh",
IF(BEGINS(Phone , "(919)"),"Charlotte",
IF(BEGINS(Phone , "(813):(727):(941)"),"Tampa",
IF(BEGINS(Phone , "(321):(407)"),"Orlando",
IF(BEGINS(Phone , "(904)"),"Jacksonville",
IF(BEGINS(Phone , "(770):(678):(404)"),"Atlanta",
IF(BEGINS(Phone , "(914):(631):(516):(347):(718):(917):(212):(646):(862):(973):(201):(551)"),"NYC - Newark",
IF(BEGINS(Phone , "(484):(610):(835):(215):(267):(856):(609):(302)"),"Philadelphia",
IF(BEGINS( Phone , "(781):(857):(339):(617)"),"Boston",
IF(BEGINS(Phone , "(716):(858)"),"Buffalo",
IF(BEGINS(Phone , "(860)"),"Hartford",
IF(BEGINS(Phone , "(401)"),"Providence",
IF(BEGINS(Phone , "(305):(786):(954):(754)"),"Miami",
IF(BEGINS(Phone , "(412):(878)"),"Pittsburgh",
IF(BEGINS(Phone , "(513)"),"Cincinnati",
IF(BEGINS(Phone , "(216):(440)"),"Cleveland",
IF(BEGINS(Phone , "(614)"),"Columbus",
IF(BEGINS(Phone , "(571):(703):(202):(240):(301)"),"DC",
IF(BEGINS(Phone , "(410):(443)"),"Baltimore",
"?-Non-metro")))))))))))))))))))))
Not quite sure what the issue you are seeing is, but my guess is that you see a "?-Non-Metro" for any of the cities you are using the OR for. If that is the case, it is because you are using an invalid OR designation. By including the : in the quotes you are using them as a matching string. So to get "Raleigh" the number would have to start with the string "(704):(980)".
I was able to get what I think you are looking for with the formula:
Hope this helps.
Jay
All Answers
Not quite sure what the issue you are seeing is, but my guess is that you see a "?-Non-Metro" for any of the cities you are using the OR for. If that is the case, it is because you are using an invalid OR designation. By including the : in the quotes you are using them as a matching string. So to get "Raleigh" the number would have to start with the string "(704):(980)".
I was able to get what I think you are looking for with the formula:
Hope this helps.
Jay
Thank you so much Jay, that worked. So || is an OR funciton, great to know!
Thanks again
Yes. You can also use the OR( test1, test2, test3, ...) format also
Would this be the correct syntax to utilize OR? Trying to limit the key strokes a bit here...
IF(BEGINS(Phone , OR ("(704)","(980)")),"Raleigh", <else_condition>)
For some reason I can't get this to work... I keep getting this error: Expected Boolean, received text.
I am trying to add a few more IF statements but I am running into the 5000 character limit so figuring out how to limit the characters in these IF statements is key. Thanks for any help / guidance.
The error means that for a True/False conditin (such as an If Statenemt) instead of a true/false, you are trying to pass in a text value. I would need to see the exact formula to determine what the issue is.
the character limit is something you will have to deal with. Generally, if you are getting to a point where there is no way to reduce the characters, i recommend going with an Apex Trigger. The idea would be to do an update in the trigger to set the field instead of having a formula field. You will have a little more leeway with the format that way.
Hope this helps.
Jay