Gracie
Gracie

Reputation: 956

HTML concatenate functions producing strange outputs in Google Sheets

I am trying to build some concatenate functions to work with HTML.

The functions are almost there, but when I copy the result from Google Sheets the formula doesn't pick up the dynanic value from another cell:

=CONCATENATE("<div class=""audio-container"" style=""display:flex;justify-content:center;align-items:center;""><audio controls><source src="",B3,"" type=""audio/mpeg""></source></audio></div>")

FORMULA OUTPUT: <div class="audio-container" style="display:flex;justify-content:center;align-items:center;"><audio controls><source src=",B3," type="audio/mpeg"></source></audio></div>

ISSUE: The B6 CELL reference containg the string download.mp3 is not inserting

I think it is something to do with the HTML double quotes, even though they seem to output correctly, but the cell reference seems to be ignored and is being recognized as a string instead.

Upvotes: 2

Views: 336

Answers (1)

You were almost there. I got:

enter image description here

=CONCATENATE("<div class=""audio-container"" style=""display:flex;justify-content:center;align-items:center;""><audio controls><source src=""";B1;""" type=""audio/mpeg""></source></audio></div>")

The output I get is: <div class="audio-container" style="display:flex;justify-content:center;align-items:center;"><audio controls><source src="download.mp3" type="audio/mpeg"></source></audio></div>

You were right, the problem was in the double quotes. You had to add a third one. Look at the part ...src=""";B1;""" type=.... That fixed everything.

Upvotes: 1

Related Questions