title: Google Sheets row to array
body: <p>I need to create an array out of google sheets columns:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>product</th>
  <th>feature_a</th>
  <th>feature_b</th>
  <th>feature_c</th>
  <th>Array</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>p1</td>
  <td>1</td>
  <td>1</td>
  <td>1</td>
  <td>[&quot;feature_a&quot;,&quot;feature_b&quot;,&quot;feature_c&quot;,]</td>
  </tr>
  <tr>
  <td>p2</td>
  <td>0</td>
  <td>1</td>
  <td>0</td>
  <td>[&quot;feature_b&quot;,]</td>
  </tr>
  <tr>
  <td>p3</td>
  <td>1</td>
  <td>0</td>
  <td>0</td>
  <td>[&quot;feature_a&quot;,]</td>
  </tr>
  <tr>
  <td>p4</td>
  <td>0</td>
  <td>0</td>
  <td>0</td>
  <td>[]</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Currently my formula is</p>
  <pre><code>=ArrayFormula(if(isblank(A2:A);&quot;&quot;;&quot;[&quot; &amp; if(B2:B = 1; concatenate(char(34);$B$1; char(34);char(44));&quot;&quot;) &amp; if(C2:C = 1; concatenate(char(34);$C$1; char(34);char(44));&quot;&quot;) &amp; if(D2:D = 1; concatenate(char(34);$D$1; char(34);char(44));&quot;&quot;) &amp; &quot;]&quot;))
  </code></pre>
  <p>Is there a more elegant way to achieve this, esp. without referencing each column individually? My original sheet has much more columns.</p>
  <p>Google sheet:
  <a href="https://i.stack.imgur.com/zFCgK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zFCgK.png" alt="enter image description here" /></a></p>