=“Bank Balance Forward on Sept 1, “ & left(A1,1,4) not working

Where A1 contains text 2021-2022

=“Bank Balance Forward on Sept 1, “ & LEFT(A1,1,4) not working,
=LEFT(A1,1,4) however works.
In first case the formula appears visible as text in Cell,
in second case below, it generates Error 509
="Bank Ending Balance on Aug 31, " & RIGHT(A1,6,4)

Does the comma before the ending quote need to be escaped?
Sometimes LibreCalc changes quotes to backquotes (Smart quote?) but this does not seem to be case here.

@Genesis1, Maybe the problem are at the quotes: “ " .

However, I strongly doubt that even =LEFT(A1,1,4) would work… see answer.

Hello,

you do use function RIGHT() and LEFT() incorrectly, by assuming you need to add a starting character and the number of characters (just like MID() does). These 2 function always start with the 1st character at the end, which is indicated by their respective name.

LibreOffice Help - LEFT - you are using 3 arguments - so probably you mean: LEFT(A1;4)
LibreOffice Help - RIGHT - you are using 3 arguments - so probably you mean: RIGHT(A1;4)

Related to @LeroyG’s comment: Check whether Tools -> AutoCorrect Options -> Tab: Localized Option: -> Section: Double Quotes -> Option: [x] Replace replaced the double quotes by a typographical version of double quotes, which are not recognized during string construction.

Can’t resist: Personally I find this a very strange default setting for a tool designed to perform calculations and not to create typographical text documents.

Hope that helps.

@anon73440385 I got that 3 parameter syntax when i did a search. I thought it was weird because i’m used to left(string,count) in other scripting languages.
@LeroyG I see the wierd quotes got in there again :frowning: I have to fix that first. It seem to be cropping up too often, thanks

Correcting the quotes and syntax fixed my problems , thank you.

@LeroyG The Dialog shows the proper " double quote characters. It does not show the backwards ones. I unchecked REPLACE box.

@Genesis1 - If the answer works for you, please consider to click the check mark (:heavy_check_mark:) next to the answer. Thanks in advance …