Home > technology > remove apostrophes before numbers in OpenOffice Calc

remove apostrophes before numbers in OpenOffice Calc

November 29th, 2009 Leave a comment Go to comments
Number of Views: 12006

The Problem:

You have a spreadsheet that has a column of what you think are numbers in it.  The numbers display fine in their cells, but when you try to do something with them, you find that you can’t.  For example, you may want to sort them or use them as part of a calculation and it doesn’t work.  Here is a screenshot illustrating that the numbers look like numbers in their cells:

apostrophe problem - 01

If you click on one of the cells, you’ll see that the numbers actually have a hidden apostrophe in front of them, like you see in this screenshot:

apostrophe problem - 02

After spending some time on the internet, I finally found out what is going on.  While you think those are numbers, the apostrophe is Calc’s way of saying that the numbers you see are to be treated as text, but they are in a cell that is formatted as a “number.”  You can verify this by right-clicking on the cell, selecting “Format cells” and then clicking on the “Numbers” tab, as illustrated in the screenshots below:

apostrophe problem - 03

apostrophe problem - 04

So, the spreadsheet program is treating a series of number as text in a cell formatted as numbers.  Talk about aggravating.

The Solution:

There is a solution for this.  It involves a “find and replace” function.  From the “Edit” menu, choose “Find & Replace.”  In the “Find” box, type “^.” (i.e., carat + period).  In the “Replace” box, type “&” (without the quotes, of course).  But you have to do one more thing for this to work.  At the bottom of the “Find & Replace” window you’ll see a button that says “More Options.”   Click on it, then select the box next to “Regular Expressions.”  You should now have a “Find & Replace” box that looks like this:

apostrophe problem - 05

Now, hit “Replace All” and all of your apostrophes will disappear.  Your series of numbers will now be seen as numbers by your spreadsheet program and will be in cells formatted as number cells.  Problem solved.

Notes:

I actually don’t know how/why this works, but it does.  I found the solution here.

Categories: technology Tags:
  1. Mike
    December 13th, 2012 at 15:11 | #1

    The text to columns suggestion worked and got rid of the apostrophes that were changing my numbers into text. However, after saving the file and reopening it, the apostrophes are back. Does anyone know if there’s a default setting that is causing this?

  2. FLOG51
    January 16th, 2013 at 22:39 | #2

    Thanks, first fix I have found that is immediate. A lot of the other Formatting suggestions have not worked.

  3. BigBob
    January 18th, 2013 at 12:07 | #3

    I’ve wasted several hours trying to figure this out in calc. I finally googled the problem and you solution popped. It works. Thank you!

  4. cmbmcn
    January 30th, 2013 at 20:34 | #4

    Mike :
    The text to columns suggestion worked and got rid of the apostrophes that were changing my numbers into text. However, after saving the file and reopening it, the apostrophes are back. Does anyone know if there’s a default setting that is causing this?

    Mike I have only had this problem with date columns imported using csv files. This solution works for me. Highlight the entire column with the offending invisible apostrophe;
    click on Data > Text to Columns > click OK
    in the resulting dialog box. I have never changed the options in the Text to Columns dialog box but the apostrophes disappear. I then can format the dates as needed.

    One further error I get is if the Default language is set to English(USA), I can’t format the entire column of dates as yyyy/mm/dd for import into the database unless I change the default language to English(UK).

  5. PB
    February 21st, 2013 at 09:04 | #5

    @cmbmcn
    Text to Columns solved it for me ! You have no idea how annoying this issue has been (maybe you have). Thanks!

  6. NAumond
    February 25th, 2013 at 19:35 | #6

    Thank you so much!

  7. CB
    March 30th, 2013 at 18:03 | #7

    Thank you!

  8. April 5th, 2013 at 17:14 | #8

    Vielen Dank – many thanks. Just the hint i needed!
    The work of all out there doing things like this is very much appreciated!

  9. Upen
    April 18th, 2013 at 00:59 | #9

    Many Thanks Dear… My Problem gets solved using your solution. Once again thanks

  10. May 23rd, 2013 at 08:59 | #10

    That worked a treat. I’ve been putting up with this issue for years. Now I know! Thanks a lot.

Comment pages
1 2 3863
  1. May 26th, 2010 at 10:47 | #1
  2. October 26th, 2010 at 14:20 | #2
  3. April 8th, 2011 at 17:01 | #3