Find last value bigger than zero based on criteria and return the date

Yulyo

Board Regular
Joined
Jul 17, 2017
Messages
94
Dear all,

I have a short question regarding a formula and I really need your help:
So I have a big Excel table, with about 200 columns and around 300000-400000 lines.

I have a small Dropdown on Sheet2!A2 (Image 2) containing the header in Sheet1 (image 1) and on Sheet2!C2 (Image 2) I need a formula that search for the value in Sheet2!A2, on Headers in Sheet1, search for the last value bigger than zero on that column, and return the date from column B (image 1).

Image 1
1.png


Image 2
2.png


I hope I made myself understood :)
Thank you.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try this. I haven't checked it. I can help if it doesn't work.
Excel Formula:
=INDEX('Sheet1'!$B$1: $B$400000,MATCH(TRUE,INDEX('Sheet1'!$A$1:$GR$400000>0,0,MATCH($A$2,'Sheet1'!$A$1:$GR$1,0)),1))
 
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’)
 
Upvote 0
Here is a working formula:
Excel Formula:
=INDEX('Sheet1'!$B$1:$B$400000,MAX(IF(INDEX('Sheet1'!$A$1:$GR$400000,0,MATCH($A$2,'Sheet1'!$A$1:$GR$1,0))<>0,ROW('Sheet1'!$A$1:$A$400000))))
 
Upvote 0
Solution
Here is a working formula:
Excel Formula:
=INDEX('Sheet1'!$B$1:$B$400000,MAX(IF(INDEX('Sheet1'!$A$1:$GR$400000,0,MATCH($A$2,'Sheet1'!$A$1:$GR$1,0))<>0,ROW('Sheet1'!$A$1:$A$400000))))
By the way, this is an array formula. Just hitting Enter is not enough.
You should paste and press Ctrl+Shift+Enter together.
 
Upvote 0
That may not be needed, depending on what version of Excel the OP is using. ;)
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,392
Members
449,081
Latest member
JAMES KECULAH

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