Add text to empty cell based on another cell value

If A1 content is “foo”, I want that B1 shows “bar”. The same with the pair of columns C and D, and E and F, and so on.
Thanks in advance for any good idea.

I tested with conditional formatting, with formula A1="foo", and a cell style with the number format code 0;0;0;"bar".
This way “bar” is shown when a space or character is entered in the cell. So, I can enter a space to all second columns, but want to avoid this.

A cell background color added to the style is shown, but no “bar”.

imagen
if foo then bar.ods (9.4 KB)

Source question: Riempimento cella in funzione del contenuto

Conditional Formatting can only modify the format of a cell, not its content. If you want the content of a cell to be different based on the values of other cells, you need to use the IF function. Put in B1:
=IF(A1="foo";"bar";"")

Thanks for sharing.
A few hours after I posted the question, I thinked about the IF function (sometimes it’s difficult to see the obvious).