I have a table where I need to get the values of the ticked headers as shown. The ALL takes precedence and it will include all headers when ticked.

[Here is the working copy of the sheet.,](https://docs.google.com/spreadsheets/d/1uhVqSDtb-BJfrai8nUEsPQJdA7bJAtJW9a8phzRUgO4/edit?usp=sharing)

The expected values are shown in the image below.

The purple cells will have formula, H2, H3 and so for for each row.

[![enter image description here](https://i.stack.imgur.com/2N562.png)](https://i.stack.imgur.com/2N562.png)
I have tried with

```
=TRANSPOSE(FILTER(Config!A$1:A$16,(INDEX(Config!A$1:G$16,,MATCH(2,Config!$A$1:$1,0) ))=TRUE))

```