MacFileman Posted January 12, 2021 Posted January 12, 2021 Sorry... I am sure this calculation is in the forum somewhere and it's super simple. Sample Text: 123 Main Street, Boston Need the copy to the left of the comma..and then the copy to the right. I think its a LEFT calculation...?
comment Posted January 12, 2021 Posted January 12, 2021 2 minutes ago, MacFileman said: Need the copy to the left of the comma..and then the copy to the right. The following calculation will return the text before the first comma: Left ( text ; Position ( text ; "," ; 1 ; 1 ) - 1 ) Note that this assumes the given text does contain a comma - otherwise the result will be empty. To extract the text after the first comma, you can use: Right ( text ; Length ( text ) - Position ( text ; "," ; 1 ; 1 ) ) Note that "text after the first comma" includes the space immediately following the comma; if you don't want that, subtract 1 from the calculated position. Alternatively you could start by substituting the comma with a carriage return, then use the GetValue() function to retrieve one of the resulting values. This is often a convenient shortcut - but it's usefulness is limited to specific cases. If you want to be able to parse any text, I recommend getting familiar with the basic method using Left(), Right(), Middle(), Position() and Length() functions. 1
MacFileman Posted January 12, 2021 Author Posted January 12, 2021 MY HERO!!!! Worked instantly!!! THANK YOU!!!!!!!!!
Recommended Posts
This topic is 1477 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now