Home > technology > remove apostrophes before numbers in OpenOffice Calc

remove apostrophes before numbers in OpenOffice Calc

November 29th, 2009 ryan Leave a comment Go to comments

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. December 4th, 2009 at 14:50 | #1

    this doesn’t work for me, the search feature doesn’t find anything. I thought these were “invisible apostrophes”? Doesn’t that mean that they’re not search-able, as they’re not normal?

  2. December 4th, 2009 at 23:08 | #2

    Did you choose “regular expressions” at the bottom of the find/replace box? If not, it won’t find them.

    Also, from what I understand from the site where I got this, this doesn’t actually find and replace the apostrophes. What it actually does is recalculate all of the cells with numbers in them, turning them into numbers.

    If it’s still not working, not sure what to tell you.

    • December 4th, 2009 at 23:21 | #3

      Thanks! I started a post on oOo forums and got help. This got me on the write track though, thanks!

  3. December 8th, 2009 at 07:05 | #4

    Thanks a ton! I’ve been searching for 2 hours on this (not the apostrophe) and couldn’t find any help. Finally I noticed the ‘ in front of the numbers and started in with the searches. Found your first in google and can now stop pulling my hair out :P

  4. Mike
    February 10th, 2010 at 16:55 | #5

    Hey, this worked great for us. Thanks

  5. Piotr
    April 2nd, 2010 at 13:05 | #6

    Hey, there is simpler solution.
    Just select column with these numbers treated as text, choose Data -> Text to Columns.
    Automagically, it converts them all to numbers.

    But I didn’t find it myself, my wife did :)

  6. Pier
    May 21st, 2010 at 12:35 | #7

    WOW AWESOME!!! It works!!!!

  7. May 26th, 2010 at 10:32 | #8

    @Piotr
    Thank you very much. I’m wondering what’s the purpose of that option. Nevertheless it worked like a charm.

  1. May 26th, 2010 at 10:47 | #1

Switch to our mobile site