How to lookup last non-zero value and return column header in Excel?
Author: XiaoyangLast Modified: 2022-12-15
Have you ever tried to lookup the last non-zero value from a row and return its corresponding column header in Excel? This article will introduce some formulas for you to completing this task.
Lookup last non-zero value and return column header with formulas
To identify the last non-zero value and return the heading of that column, please apply any one of the below formulas:
=INDEX($B$1:$J$1,MAX((COLUMN(B2:J2)-MIN(COLUMN(B2:J2))+1)*(B2:J2<>0))) (Press Ctrl + Shift + Enter keys) =LOOKUP(2,1/(B2:J2<>0),$B$1:$J$1) (Press Enter key)
Note: In the above formula, B1:J1 is the column headers that you want to return, B2:J2 is the data row you want to find the last non-zero value.
Then, drag the fill handle down to fill the formula to other cells, see screenshot:
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...