Excel Formula Help - In Which Year did X Occur

Sundance_Kid

Board Regular
Joined
Sep 2, 2017
Messages
130
Office Version
  1. 365
Platform
  1. Windows
Hi,

See the below image, I want a formula to tell me in which year (most recent) was the last amount of Sales greater than 0. AS you can see for Product A that will have been 2021, but for Product B it will be 2024.

Is there some formula that can return the correct (most recent) year.

Thanks

Excel Formula Query_15.11.2023.png
 
For the lookup function the data must be sorted ascending, {1,0,0,0,0,0} is not.
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Ah I see after reading up on various internet searches on lookup I was under the impression that the look up data needed to be in ascending order and was that (not so much the looking at the outcome needing to be)

ie The data was arranged 2019, 2020, etc up to 2024

Thanks though I would never have seen that!
 
Upvote 0

Forum statistics

Threads
1,215,553
Messages
6,125,483
Members
449,233
Latest member
Deardevil

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