How do I enter numbers as text in Calc- a bug?

I am creating an index for a book.
I can key in page numbers in a column cell such as 15,17,34,45,46,48 no problem.
But such as 118,119 or 161,162,163,164 and the commas disappear in the column cell.

Hi pjbw,

no, this is not a bug. Calc only tries to interpret your numbers as numbers.

You can easily prevent this by formatting the cells concerned as text before entering your page numbers. Press Ctrl + 1 or menu - format- cells - numbers - and then select the text format in the numbers tab.

Hello,

If 161,162,163,164 turns to a number (commas disappearing), then obviously in your country (locale) setting, comma (,) is used as thousands separator and LibreOffice recognizes this as a number using a thousands separator, while 15,17,34,45,46,48 doesn’t look like a number using a thousand separator.Your choices are:

  1. Change the thousand separator by using another language for the respective cells –or
  2. Preprend a single quote to number sequences which could be interpreted as a number using thousands separator (i.e. enter '161,162,163,164) –or
  3. Move to another separator of your number (e.g. use a semicolon like 161;162;163;164 and 15;17;34;45;46;48

Note: I’d prefer and recommend option 2.

Hope that helps.

I eventually gave up and used comma:space (ASCII Dec 32:44).
I set my pages column to English UK which I speak where the decimal delimiter is dot (ASCII Dec 46) but Calc still insists on displaying 123,456 as 123456.

Did you read Opaque’s comment no 2. If you prepend the numbers with a single quote ' then the following will be recognised as text. The single quote will not be printed

Also dscheikey’s solution Format the column as Text then you can enter numbers as text

Why ask if you don’t want to even try the answers?

Please accept my most sincere apologies. I wasn’t told that that the single quote wouldn’t appear.
Maybe I should have used my Microsoft Excel and then I wouldn’t have got your reply.

Excel will also assume your commas are thousands separators. The answers also apply to Excel

Manual indexing can’t be much fun. Writer has some powerful tools to help with indexing

I’ve nearly finished commas:spaces for the index for father-in-law’s WWII diary. Typed by him on a worn-out German typewriter without double quotes and with handwritten comments and corrections and photocopied by the IWM ! The real breakthrough was finding the ABBY FineReader OCR. I transcribed the scans using LibreOffice Write and OpenOffice Writer - horses for courses!.
I looked at some Indexing software but their output would have needed so much editing that it was easier to do it all in Calc from the publisher’s final PDF draft. (Calc sorted my 800+ rows almost instantaneously).
PS My Microsoft Office is prehistoric and I am no longer allowed to upgrade it - sorry.

Have a look at Writer Guide 6.4 and page 333 starts Indexing, but of particular interest is Concordance file. Probably best to read the entire chapter.
Cheers, Al