Quick LibraOffice calc help please
Quick LibraOffice calc help please
Author
Discussion

audi321

Original Poster:

6,166 posts

243 months

Thursday 23rd March 2023
quotequote all
Hi all, I only have access to LibraOffice Calc at the moment, and I cannot find the function 'TEXTBEFORE' which I regularly would use in Excel.

I want to choose all text from a cell before a comma, for example "03/22/23, blah blah blah", and I only want to return "03/22/23" in another cell. Problem is the piece before the comma changes in length - ie. it could be "3/2/23, blah blah" so I cannot simply use =LEFT(A1,6) as the 6 changes too often in length.

Any ideas what I can do? LibraOffice has it's limitations grrrrr

21TonyK

13,334 posts

239 months

Thursday 23rd March 2023
quotequote all
has is it got FIND to locate the "," or INSTR ?

Mr Pointy

13,406 posts

189 months

Thursday 23rd March 2023
quotequote all
Could you use the SPLIT function with the comma as the delimiter

Split (Text As String, delimiter, number)

https://help.libreoffice.org/6.2/en-US/text/sbasic...

audi321

Original Poster:

6,166 posts

243 months

Friday 24th March 2023
quotequote all
That looks a bit too complex for me. Can anyone think of an alternative (easier) option?

Thanks again for any help.

nd0000

262 posts

150 months

Friday 24th March 2023
quotequote all
You have to do something like LEFT(A1, FIND(A1, ",") - 1)