Need help tweaking IF/THEN formula if cell is blank

Hello. I am learning Calc in LibreOffice version 7.5 on a Windows 10 desktop.
.
I have a formula that concatenates the cells in 3 columns (G, H, and Y). These columns display the date, the description, and the place.
.
For row 1, my current formula is:

=CONCATENATE(TEXT(G1,"yyyy-mm-dd"),": ",H1," [At ",Y1,".]")

.
However, this formula still displays [At .] even if the Y1 cell (name of place) is empty. I would like to tweak this Y1 portion of this formula so that if Y1 is empty, it displays NOTHING. Otherwise, display the Y segment as written: [At “,Y1,”.]"
.
I have tried to modify this with the following adjustment… but it does NOT work:
.
=CONCATENATE(TEXT(G1,"yyyy-mm-dd"),": ",H1," IF(ISBLANK(Y1),"","[At ",Y1,".]"))
.
Does anyone have a suggestion as to how to make this work?

=(TEXT(G1;"yyyy-mm-dd"))&(": "&H1)&(IF(Y1="";"";(" [At "&Y1&".]")))

To replace ; per ,
On your machine.

1 Like

For to compare:
...,H1," IF(ISBLANK(Y1),"","[At ",Y1,".]")) Yours
...,H1," ",IF(ISBLANK(Y1),"","[At "&Y1&".]")) Correct
.
With semicolons =CONCATENATE(TEXT(G1;"yyyy-mm-dd");": ";H1;" ";IF(ISBLANK(Y1);"";"[At "&Y1&".]"))

@schiavinatto formula is shorter, and do the work with less clutter.

1 Like

Thank you both so much! Works great!

1 Like

Maybe TEXTJOIN function can help by using ‘Skip empty’ argument.

2 Likes

=TEXTJOIN( ;1;TEXT(G1;"yyyy-mm-dd");": ";H1;" ";TEXT(Y1;"\[At @\.\]"))
.
But I can solve the last value if the cell is empty only with ISBLANK.
=TEXTJOIN( ;1;TEXT(G1;"yyyy-mm-dd");": ";H1;" ";IF(ISBLANK(Y1);"";"[At "&Y1&".]"))

TEXTJOIN with empty cell.ods (11.1 KB)