Formula to count the number of characters after a symbol
Hello. I am attempting to write a formula that will count the number of characters that follow a "-", and use the resulting number to determine if the type should be a "PO" or a "SWA" using an IF statement.
I found a formula that will pull those characters following the "-", but it just gives me the actual 2 numbers following the dash, what I need to write the formula is:
IF (PO/SWA No@row) = 2 characters, "PO", otherwise "SWA"
Best Answer
-
Oh I see... Try this rendition.
=IF(LEN(RIGHT([PO / SWA No]@row, LEN([PO / SWA No]@row) - FIND("-", [PO / SWA No]@row)))=2, "PO", "SWA")
Answers
-
Try this: =IF(LEN([PO / SWA No]@row)=2, "PO", "SWA"
For more on the LEN Function see:
-
Hi @Mike Wilday , I tried that out but the formula returns the same Agreement Type every time, no matter the digits after the dash:
This is the formula I am using in row 1 that I have been attempting to modify to reach my desired end point: =RIGHT([PO / SWA No]@row, LEN([PO / SWA No]@row) - FIND("-", [PO / SWA No]@row))
-
Oh I see... Try this rendition.
=IF(LEN(RIGHT([PO / SWA No]@row, LEN([PO / SWA No]@row) - FIND("-", [PO / SWA No]@row)))=2, "PO", "SWA")
-
Great, that worked, thanks for your help!
-
Awesome, glad I could help you out.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!