How to return a column title on given conditions

Imagine a complex data set where each department, in a corporation, spends on variety of items (example data set given below). How to get a summary of what each department spent? In our example how to find answers to the question marks? Dept 1 spent on “Maintenance”, “IT”, “Infrastructure” and did not spend on others. Continue reading “How to return a column title on given conditions”