Forum Discussion

SuzyKania's avatar
SuzyKania
Qrew Cadet
2 months ago

Left function stripping on first "-" rather than "-O" as written

Using function Left in a formula to pull all text before a trailing "-O"

If the Code has a "-" in the middle, it pulls back value prior to first "-"

Code = JKL-6-O  results in JKL

I've tried 

Left([Code],"-O") and Left([Code],";-O,") with both resulting in JKL

What is correct syntax to only strip "-O"?

2 Replies

  • DougHenning1's avatar
    DougHenning1
    Community Manager

    NotRight("JKL-6-O", "-") will split at the last delimiter and returns "JKL-6"

    • SuzyKania's avatar
      SuzyKania
      Qrew Cadet

      Thanks so much.  I thought I tried that but it left the second -.  I was probably still using -O instead of focusing on the -.  Appreciate the help.