简体   繁体   中英

Formula to find the header index of the first non blank cell of a range in Excel?

I have this table, which can be seen as a basic custom gantt chart:

表格1

And I would like to fill the A column with start dates, based on the first filled cell of the range on the same row, and the header value of its respective column (row 1). It's easier to show my expected result than write it actually:

在此输入图像描述

Thanks very much for your help!

In A2 try this formula copied down

=IF(COUNTA(B2:Z2),INDEX(B$1:Z$1,MATCH(TRUE,INDEX(B2:Z2<>"",0),0)),"")

you may have to format column A with the required date format

assumes data up to column Z, adjust as required

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM