List of data col A with different values input into the appropriate col C-F. I want to have B reference the column header the value is in.
So in this example rows A2-A8 are my line items where their values are recorded in the appropriate product column, and I want that product column header to be shown in column B next to the appropriate line item: here Item A3 has a value recorded in col with header D1 so 'D1' appears in the cell next to item A3.
I know I can do this manually by filtering each column excluding blank cells, and then copy/paste the col header into the remaining cells in col B, but this is quite laborious and I'd like a formula to do it so it happens everytime a new line/row is added with data.
I know I could use a very long 'if' or 'ifs' formula but hoping for something simpler.
So in this example rows A2-A8 are my line items where their values are recorded in the appropriate product column, and I want that product column header to be shown in column B next to the appropriate line item: here Item A3 has a value recorded in col with header D1 so 'D1' appears in the cell next to item A3.
Item | Product | C1 | D1 | E1 | F1 | G1 | H1 |
A2 | F1 | 2 | |||||
A3 | D1 | 3 | |||||
A4 | G1 | 4 | |||||
A5 | C1 | 5 | |||||
A6 | E1 | 6 | |||||
A7 | D1 | 7 | |||||
A8 | H1 | 8 |
I know I can do this manually by filtering each column excluding blank cells, and then copy/paste the col header into the remaining cells in col B, but this is quite laborious and I'd like a formula to do it so it happens everytime a new line/row is added with data.
I know I could use a very long 'if' or 'ifs' formula but hoping for something simpler.