Vlookup - last result across columns

MOB

Well-known Member
Joined
Oct 18, 2005
Messages
1,056
Office Version
  1. 365
Platform
  1. Windows
Row 1 has alternate headings - Planned Undertaken Planned Undertaken............repeating

Column A has persons' names

I need a vlookup (?) that looks in column A for that persons name, and returns the last non-blank entry on that row, which is also under a heading "Undertaken"

Any ideas?!

TIA
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
=LOOKUP(REPT("z",255),INDEX($B$2:$Z$2,MATCH("name",$A$2:$A$100,0),0))

assuming that we are looking for a text value. Otherwise, replace REPT("z",255) with 9.99999999999999E+307.
 
Upvote 0
Thanks - very nearly works, the only issue that it is returning the very last entry on that row.............I need it to return the very last entry on that row, so long as the text in row 1 is "undertaken"

Is this possible?

Thanks
 
Upvote 0
Perhaps this array formula:

=LOOKUP(REPT("Z",255),INDEX(IF($B$1:$Z$1="Undertaken",$B$2:$Z$100,NA()),MATCH("name1",$A$2:$A$100,0)))

or non-array entered:

=LOOKUP(2,1/($B$1:$Z$1="Undertaken")/(INDEX($B$2:$Z$5,MATCH("name1",$A$2:$A$5,0),0)<>""),INDEX($B$2:$Z$5,MATCH("name1",$A$2:$A$5,0),0))
 
Upvote 0
Hi

First formula - appears to be going across to the final instance of row A containing "Undertaken", even if it is blank - I need the last non-blank

Second formula...............seems to work perfectly!!

Many thanks
 
Upvote 0
Are the 'blank' cells actually empty, or do they have formulas in?
 
Upvote 0
I can't see offhand why it wouldn't have worked. You did array-enter it?
 
Upvote 0
That would be it................oops.

Thanks for your help with this, saved a colleague considerable manual input each month.
 
Upvote 0

Forum statistics

Threads
1,216,551
Messages
6,131,310
Members
449,642
Latest member
jobon

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