Show the column header to a row if there is value in cells of that columns without VBA

后端 未结 4 393
刺人心
刺人心 2021-01-13 15:56

Update 1:

Because my question is not clear, so I post second example

\"Example

Because row

4条回答
  •  醉酒成梦
    2021-01-13 16:44

    Assuming that you want a solution with more than 3 columns, this formula will return you the right header.

    I assume that you data starts in row 2, column B - and row 1 contains the column headers.

    Use this formula in B1 and copy it down:

    =IF(COUNTA($B2:$D2)=0,"",INDEX($B$1:$D$1,MATCH(FALSE,INDEX(ISBLANK($B2:$D2),0),0)))
    

    If your data extends further than column D, simply change this in the formula.

提交回复
热议问题