Looks like Spreadsheet, though tagged Excel : Question
const onOpen = () => {
SpreadsheetApp.getActive().addMenu("Custom", [
{
name: "q256332",
functionName: "q256332"
}
]);
}
const q256332 = () => {
const mark = "○";
const range = SpreadsheetApp.getActiveRange();
let table = range.getValues();
const header = table.shift();
SpreadsheetApp.getActiveSheet().getRange(range.getRow()+table.length+2,range.getColumn(),table.length,2).setValues(table.map(item=>[item[0],(item.reduce((a,c,i)=>c===mark?a.concat(header[i]):a,[])).join(",")]));
}