Peter
Peter

Reputation: 13

LibreOffice Calc, error 509 in if function

I am new to calc, currently I am trying to write a simple if function, in which it compares whether a string in 2 cells is longer than 130 characters, if it is longer it just pastes the value of first cell, if its not, it pastes value of both cells.

Can anybody help me? Thank you

I have tried looking up some examples for if functions, concatenate function and others to see, if I am not missing any brackets etc.

Here is the function I have created

=IF(LEN(CONCATENATE(D2" ";K2)) >130; D2; CONCATENATE(D2" ";K2))

I expect it to work, as I described above.

Upvotes: 1

Views: 3768

Answers (1)

acesmndr
acesmndr

Reputation: 8515

Shouldn't you have the space escaped by commas/semicolons

=IF(LEN(CONCATENATE(D2," ",K2)) > 130, D2, CONCATENATE(D2," ",K2))

CONCATENATE concatenates strings. It does work in google sheets. So the equivalent would be something like:

=IF(LEN(CONCATENATE(D2;" ";K2)) > 130; D2; CONCATENATE(D2;" ";K2))

Upvotes: 0

Related Questions