I have table with data in the format below.
I want the finished table to have the blank column to be populated like the highlighted one below.
So, I need a formula or VBA that will return and concatenate the headers of non-blank cells in each row.
I have table with data in the format below.
I want the finished table to have the blank column to be populated like the highlighted one below.
So, I need a formula or VBA that will return and concatenate the headers of non-blank cells in each row.
Use¹ the following as an array formula.
Pre-Excel 2016 versions
While you could just string together a series of IF statements, a cleaner alternate might be to write a user defined function (aka UDF).
In a standard VBA module code sheet:
¹ The TEXTJOIN was introduced with Excel 2016 in the following versions:Excel for Android phones, Excel Mobile, Excel 2016 with Office 365, Excel 2016 for Mac, Excel Online, Excel for iPad, Excel for iPhone and Excel for Android tablet.