简体   繁体   中英

Find nth row value in Excel

I'm trying to find the nth non-blank value in a row and return that cell's contents.

My current formula looks like this in cell V2: =INDEX(W4:AL4, MATCH(TRUE, W4:AL4<>"",0))

This finds the first match perfectly, but in the adjacent row I need to find the next nonblank cell as well.

All my values are text, the distance between cells is unclear, and there will always be at least one value.

How do I change my formula so that I can find the 2nd, 3rd, nth value in a row using multiple formula?

=INDEX(W4:AL4,AGGREGATE(15,6,COLUMN(W4:AL4)/--(W4:AL4<>""),1)-COLUMN(W4)+1)

Change the first 1 to your nth value. It will be the first non blank column in your range.

If you change the 15 to 14 then first 1 will become the last column that is not blank in your range.

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