title: Array formula to join header values in a Google Sheet when row values equal "yes"
body: <p>I saw <a href="https://stackoverflow.com/questions/64206161/searching-for-a-arrayformula-that-looks-up-and-joins-header-titles">this</a> question but was not able to get it to work for me. Since it is already answered and from an year ago I felt it best to post a new question.</p>
  <p>I have a sample sheet at: <a href="https://docs.google.com/spreadsheets/d/1EqNfTWcNFgkv2gdovnH7JpqU9V2HG5Vkoup8bhNqI7k/edit#gid=0" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1EqNfTWcNFgkv2gdovnH7JpqU9V2HG5Vkoup8bhNqI7k/edit#gid=0</a></p>
  <p>In <code>F1</code> I want an array formula that will join the values of <code>B1:E1</code> if <code>B2:E = &quot;yes&quot;</code>.</p>
  <p>Column <code>G</code> has the expected output.</p>
  <p>This is what I came up with but it's giving error:</p>
  <pre><code>={
      &quot;output&quot;;
      ARRAYFORMULA(
          IF(
              A2:A = &quot;&quot;,
              ,
              IF(
                  B2:E = &quot;yes&quot;,
                  TEXTJOIN(&quot;, &quot;, TRUE, B1:E1),
              )
          )
      )
  }
  </code></pre>