"Find" Function Not Working in Calc

Hello.
Using v7.3.5.2, Windows 10/64

I have a file with a very long string of IF commands, when I select the contents of the cell there are no carriage returns. I want to add a carriage return to each line so that I can scroll through the formula and make changes to individual lines as needed, but for some reason, using the Find-Replace function, it always says “Search Key Not Found” when looking for “IF”.

When I copy/paste the text into LibreOfficeWriter and use the Find/Replace function, it works fine, but when I copy/paste back from Writer to Calc, the carriage returns disappear. The only way I can have carriage returns is to do each line manually, but there are dozens of lines, and this process is repeated in a lot of cells. Is this a bug or am I still doing something wrong? Thank you.

You should check if Entire cells is not checked, and if Search in: is Formulas.

image

… but I wonder how would it help you, given that you can’t add newlines in Calc using Find & Replace. As explained in the help:

\n Has no special meaning in Calc, and is treated literally there.

Works fine for me. Note that you MUST paste into the cell (i.e. hit F2 first), not into the Input Line.

1 Like

Please reconsider the subject of you question.
Your actual issue are the missing hard breaks, The FIND() is working correctly.

It’s a strange idea to edit multiline Calc formulas in Writer, but it’s feasible:

  • Use full paragraph breaks in Writer.
  • Copy the group of paragraphs containing the multiline formula.
  • Go to the target cell in your spreadsheet…
  • Enter edit mode (F2)
  • Select all the current content.
  • Paste (Ctrl+V)
  • Quit edit mode (Enter).

Using the formula bar you may need to select all the previous content and then to PasteSpecial (Shift+Ctrl+V) sellecting Unformatted text and quit with Enter.

BTW: I’m using Calc for decades now, but never had a reason to do as described. (I had to “research” the needed steps.) You should considerif your problemis one of the X-Y-Type and reconsidering your original task might be more valuable than to find an exotic proceeding. .
Deeply nested IF() is a bad idea in most cases, anyway.

Multiline formulas editerd in a Writer document with

  • Enter between the formulas like a paragraph break
  • Shift+Enter inside the formulas like hard linebreaks.

you can Copy and Paste intermediarily into a TextBox shape .
Copying them from there again and pasing subsequently into a spreadsheet should fill the needed range of cells and preserve the internal linebreaks.
Unfortunately there seems to be no way to distinguish the different types of breaks visually in the TextBox.(Tested with LibO V7.3.2 under Win 10.)

That (The F2 Key) works! Thank you! When I get back to the project I will employ this!

-J