# Discussions

View Only

## A ""begin"" formula with OR statements to sort companies into groups by first letter

• #### 1.  A ""begin"" formula with OR statements to sort companies into groups by first letter

Bronze
Contributor
Posted 06-21-2017 14:36
I am trying to create a formula to assign companies into groups based on their first letter automatically. I am unsure if I am using the correct formula. My current approach is
`If (Begins([Company Name],"a") OR Begins([Company Name],"b") OR Begins([Company Name],"c") OR Begins([Company Name],"d") = true, "A-D Clients",(Begins([Company Name],"e") OR Begins([Company Name],"f") OR Begins([Company Name],"g") OR Begins([Company Name],"h") OR Begins([Company Name],"i") OR Begins([Company Name],"j") OR Begins([Company Name],"k") = true, "E-K Clients",(Begins([Company Name],"l") OR Begins([Company Name],"m") OR Begins([Company Name],"n") OR Begins([Company Name],"o") = true, "L-O Clients",(Begins([Company Name],"p") OR Begins([Company Name],"q") OR Begins([Company Name],"r") = true, "P-R Clients",(Begins([Company Name],"s") OR Begins([Company Name],"t") = true, "S-T Clients",(Begins([Company Name],"u") OR Begins([Company Name],"v") OR Begins([Company Name],"w") OR Begins([Company Name],"x") OR Begins([Company Name],"y") OR Begins([Company Name],"z") = true, "U-Z Clients", False)`
Any thoughts on how I could get this working or a better approach?

• #### 2.  RE: A ""begin"" formula with OR statements to sort companies into groups by first letter

Top
Contributor
Posted 06-21-2017 14:53
Try this
`If(  Begins([Company Name],"a")    OR Begins([Company Name],"b")    OR Begins([Company Name],"c")    OR Begins([Company Name],"d"), "A-D Clients",Begins([Company Name],"e")    OR Begins([Company Name],"f")    OR Begins([Company Name],"g")    OR Begins([Company Name],"h")    OR Begins([Company Name],"i")    OR Begins([Company Name],"j")    OR Begins([Company Name],"k"), "E-K Clients",Begins([Company Name],"l")    OR Begins([Company Name],"m")    OR Begins([Company Name],"n")    OR Begins([Company Name],"o"), "L-O Clients",Begins([Company Name],"p")    OR Begins([Company Name],"q")    OR Begins([Company Name],"r"), "P-R Clients",Begins([Company Name],"s")    OR Begins([Company Name],"t"), "S-T Clients",`
Begins([Company Name],"u")
OR Begins([Company Name],"v")
OR Begins([Company Name],"w")
OR Begins([Company Name],"x")
OR Begins([Company Name],"y")
OR Begins([Company Name],"z"), "U-Z Clients")

• #### 3.  RE: A ""begin"" formula with OR statements to sort companies into groups by first letter

Bronze
Contributor
Posted 06-21-2017 15:38
This did it!
Thank you!