Lookup Table/column Header based on Last Row of Data (first blank value found)

GauzeD

New Member
Joined
Feb 3, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello...been forever since I have posted here but I have hit a roadblock and the fine folks at MrExcel always come through :)

See sample table below...I am attempting to find a formula that applies the column header (dates) into the LastDate column based on the last data entry for each person (represent hours per for each month). The end game is to find out when each persons last date of project work is supposed to be. The expected results were manually put into the LastDate column as shown below. I have hundreds of rows in the actual file I figured out the formula to find the cell that HAS the last row of data (using INDEX MATCH and ISBLANK), but I am unsure how to then also retrieve the applicable date header 'above' (so to speak).

Any help is greatly appreciated. Thanks.

Name/Date31-Jan-2528-Feb-2531-Mar-2530-Apr-2531-May-2530-Jun-25Last Date
Joe10105530-Apr-25
Jen20202020202030-Jun-25
Tim1031-Jan-25
John55531-Mar-25
Bill202028-Feb-25
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about
Fluff.xlsm
ABCDEFGH
1Name/Date31/01/202528/02/202531/03/202530/04/202531/05/202530/06/2025Last Date
2Joe10105530/04/2025
3Jen20202020202030/06/2025
4Tim1031/01/2025
5John55531/03/2025
6Bill202028/02/2025
Sheet5
Cell Formulas
RangeFormula
H2:H6H2=LOOKUP(10^9,B2:G2,$B$1:$G$1)
So close! Thanks. What if a name doesn't have any hours listed? I am currently getting an #NA error in those columns. Slapping IF(ISNA(...) around the formula seems to work, but if you have a better/easier way, I'm all ears :)
 
Upvote 0
How about
Excel Formula:
=IFNA(LOOKUP(10^9,B2:G2,$B$1:$G$1),"")

Also please respond to either of the two direct messages you have received.
 
Upvote 0
Sorry, clicked 'Reply' in your response. Still re-learing the MrExcel way :)

Well look at that...IFNA. Kind of like XLOOKUP building the 'if you get an #NA...' into it's formula. One post in and I'm already learning something new :) Ok, last question...I assume the '10^9' in the formula has something to do with looking for the first blank row. Can you explain how that works?

PS...funny how I've learned H/VLOOKUP then graduated to XLOOKUP, only to have to go back to old school LOOKUP :)
 
Upvote 0
The 10^9 is just a large number so that lookup will find the last value in the row.
 
Upvote 0
Right...because LOOKUP is looking for the 'largest' value (educating myself as we speak). Perfect. This is great. I think I have what I need. Really appreciate the help. Thanks! 👍
 
Upvote 0
Glad to help & thanks for the feedback.

As requested earlier, please respond to either of the two Direct Messages that you have received regarding your account.
 
Upvote 0

Forum statistics

Threads
1,226,466
Messages
6,191,196
Members
453,646
Latest member
SteenP

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