Search code examples
libreoffice

How to get a substring that comes after a certain character with LibreOffice's RIGHT function?


In the cell A2 I have a surname AARY followed by an open parenthesis and a forename (Max.

      |               A                              |                        B
------------------------------------------------------------------
1    |    Last name of the artist    |          First name of the artist
------------------------------------------------------------------
2    |    AARY (Max                       | Here goes the forename 'Max'


I wanted to extract the forename without the parenthesis by using the command

=RIGHT(A2,LEN(A2)-SEARCH("(",A2)),

but I get the Err:508 error in bracketing.

When I add the bracket at the end of the formula, I get the LibreOffice Calc found an error in the formula entered.

Why is this happening?


Solution

  • Commas may not work in LibreOffice depending on your settings. Semicolons work no matter what the settings are, so they are preferred unless interoperability with MS Excel is necessary.

    =RIGHT(A2;LEN(A2)-SEARCH("(";A2))