=INDEX($B$1:$K$1,MAX(COLUMN(B2:K2)*(B2:K2<>""))-COLUMN(B2)+1)
Excel - Return column header for the rightmost value?
I've got a spreadsheet with various dates across my columns (the headers). In the next row, I have data values in some, but not all, of the cells in that row. At that end of that row, I have a "latest data" column, and I would love to find a formula that would look through my row of data, find the rightmost (most recent) data point, and return the column header (date).
Here is an example of my setup and what I would like it to return.
Thanks!
Microsoft 365 and Office | Excel | For business | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
-
Anonymous
2024-05-08T14:55:19+00:00
1 additional answer
Sort by: Most helpful
-
Ashish Mathur 101K Reputation points Volunteer Moderator2024-05-08T23:18:26+00:00 Hi,
In cell K2, enter this formula and drag down
=xlookup(true,A2:J2<>"",$A$1:$J$1,,,-1)
Hope this helps.