Match a value to column header in another worksheet and retrieve last used cell data

WednesdayC

Board Regular
Joined
Nov 7, 2010
Messages
201
Office Version
  1. 2016
Platform
  1. MacOS
Hi All
Please can someone help me as I really stuck with this.
I need to match several values to another worksheet, where these values will be the column headers and retrieve the last entry in that column.
So for instance - say I am looking for "CHECK 4" on 1 sheet and this will be the header of one of the columns in another sheet - (the position of the column header will change, but it will always be a column header and assuming it is row 1 of column D for now) then I need to retrieve the last entry in column D on to my other worksheet.

I am happy with either a formula or VBA. Any help would be appreciated.

Many thanks in advance

Wednesday
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Hi Fluff

Thank you - I will do so - it is some time since I have posted.
I am using Excel 2016 (Excel for Mac)

Thanks
Wednesday
 
Upvote 0
Thanks for that, how about
Excel Formula:
=LOOKUP(2,1/(INDEX(Sheet1!A2:Z10000,,MATCH(F2,Sheet1!A1:Z1,0))<>""),INDEX(Sheet1!A2:Z10000,,MATCH(F2,Sheet1!A1:Z1,0)))
Change F2 to the cell with "Check 4"
 
Upvote 0
Solution
=LOOKUP(2,1/(INDEX(Sheet1!A2:Z10000,,MATCH(F2,Sheet1!A1:Z1,0))<>""),INDEX(Sheet1!A2:Z10000,,MATCH(F2,Sheet1!A1:Z1,0)))
Hi Fluff

Wow - it works a treat! Thank you so much.
I have spent ages trying to come up with a solution myself.

Regards
Wednesday
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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