简体   繁体   中英

Excel formula to check the last non zero value in row and bring cell value from corresponding column

can you please advise how to write a formula to:

  • identify the last non zero value in row
  • bring the value from another row at corresponding column
  • example below

Karl   Jane   Adam   Pete     Dona    
300       0     200     100      0

  • the result should be Pete
  • I tried Lookup to and can find the last non zero value is 100 but how to bring the value from another row? Thank you Tom

Using just the LOOKUP formula, you merely set your result_vector argument to the row from which you want to get the result.

Try:

=LOOKUP(2,1/(A2:E2>0),$A$1:$E$1)

(If your formula is not in the same row, you can use whole-row references)

=LOOKUP(2,1/(2:2>0),$1:$1)

To stick with LOOKUP , you could use it in INDEX :

=INDEX(1:1,LOOKUP(2,1/(2:2>0),COLUMN(2:2)))

If one has the Dynamic Array Formula XLOOKUP:

=XLOOKUP(1,1/(A2:E2>0),A1:E1,"",-1,-1)

在此处输入图像描述

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