Matching a value (name) and finding the last non zero value in that row and return the value of corresponding column header value (a date)

MazH

New Member
Joined
Mar 12, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi guys!

In my first sheet i have the list of employee names, and i would like a formula to lookup that name in the table below on sheet 2, look at that row, and return the date of the last non zero entry.

This would mean that Sam Smith returns 22 Apr 2024, Amy Andrews returns 19 Feb 2024 and Carl Crown returns 08 Apr 2024.

Help is much appreciated! I've used lookup and index formulas but it seems the sticky part is first matching the name, to know which row to look at.

TIA!



Row Labels03 Jan 202422 Jan 202405 Feb 202419 Feb 202404 Mar 202418 Mar 202408 Apr 202422 Apr 2024
Sam Smith1111
Amy Andrews1
Carl Crown2
 
Hello,
Based on the example, with top left cell (row labels) in A1, the formula below should work (with name in M2)
Excel Formula:
=INDEX($B$1:$I$1, 1, XMATCH(1, FILTER($B$2:$I$4, $A$2:$A$4=M2), 1, -1))
 
Upvote 0
Solution
Hello,
Based on the example, with top left cell (row labels) in A1, the formula below should work (with name in M2)
Excel Formula:
=INDEX($B$1:$I$1, 1, XMATCH(1, FILTER($B$2:$I$4, $A$2:$A$4=M2), 1, -1))
Thank you, unfortunately i get a #VALUE! error with this formula:

INDEX(Pivots!$B$31:$AF$31, 1, XMATCH(1, FILTER(Pivots!$B$32:$AF$46, Pivots!$A$32:$A$47='Speech Tracker'!A3), 1, -1))

This is the formula you shared, with the correct references for my spreadsheet...
 
Upvote 0
Thank you, unfortunately i get a #VALUE! error with this formula:

INDEX(Pivots!$B$31:$AF$31, 1, XMATCH(1, FILTER(Pivots!$B$32:$AF$46, Pivots!$A$32:$A$47='Speech Tracker'!A3), 1, -1))

This is the formula you shared, with the correct references for my spreadsheet...
***Updated the formula**

Thank you, unfortunately i get a #VALUE! error with this formula:

INDEX(Pivots!$B$31:$AF$31, 1, XMATCH(1, FILTER(Pivots!$B$32:$AF$32, Pivots!$A$32:$A$47='Speech Tracker'!A3), 1, -1))

This is the formula you shared, with the correct references for my spreadsheet...
 
Upvote 0
The first part of the filter should be
Excel Formula:
Pivots!$B$32:$AF$47
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top