remove parentheses from numbers in calc

I have a column of numbers in my calc file. they are all in parentheses, is there a way to remove the parentheses and only leave the number. example of numbers I have:




I would like them to simply be




also some number are also have a hyphen along with the parentheses… here is an example




I would like them to be:




thank you

Please explain if it is by a cell format, or they are numbers as text.

If you select the cell with the first example number, the Imput line (aka Formula bar) might show…

  1. (251)
  2. '(251)
  3. -251

In the cases 1 and 2, you could use a formula in a column next to the numbers: =NUMBERVALUE(REGEX(A1,"[()'-]","","g")), being A1 the cell with the value.

Also can select the cells, copy, paste in a text editor (Notepad, Gedit, TextEdit or the like); select all in the text editor, copy, and paste in the spreadsheet, wich will show a dialog box named Text Import: hitting OK should work.

More LibreOffice Help on NUMBERVALUE, REGEX.

In the case 3, you could:

  • select the cells;
  • choose menu Format - Cell… (the same that Ctrl+1) - Numbers tab, and select Category Numbers and Format Standard - OK;
  • choose menu Edit - Find & Replace…, with - in Find:, leave Replace: empty, then press Replace All.

Press edit below your question if you want to add more information; also can comment an answer.

Check the mark (Correct answer mark) to the left of the answer that solves your question.

Tested with LibreOffice (x86); OS: Windows 6.1.