Problem with formula containing IF and ISBLANK functions

I don’t understand why the result of this formula shows a trailing space.

In AB2 the trailing space from the cell "letter " has already been removed.
Only if AH2 has text should a space after AB2 be added again.
Now the space is added even though AH2 has no text. Why?

(I cannot use the TRIM function here because only spaces at the end of, not within, a cell need deleting.)

LO 24.2
macOS 12.7.4

It seems that AH2 is not blank, it contains a formula that evaluates to "". So, the False part of the IF is executed and it contains "letter" & " " & "", hence the trailing space.
You should use:
=AB2 & IF(AH2="";"";" "&AH2)

1 Like

image

1 Like