Find nearest values in two columns

Hello Experts!

I am looking for an Excel formula (or VBA) that can determine where two columns of values might meet in terms of approximate values. Column A will most likely (but not always) decrease in value over time, and Column B will most likely (but not always) increase in value over time. The formulae (or VBA) will return the year in which the two columns intersect.
Thank you,

Biker9
Two-columns.xlsx
biker9Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Maybe this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.

=INDEX(C8:C38,MATCH(MIN(ABS(D8:D38-E8:E38)),ABS(D8:D38-E8:E38),0))

Open in new window

1
Ejgil HedegaardCommented:
With 2 Index functions for the Abs part, it can be a normal formula.
=INDEX(C8:C38,MATCH(MIN(INDEX(ABS(D8:D38-E8:E38),,)),INDEX(ABS(D8:D38-E8:E38),,),0))

Open in new window

0
biker9Author Commented:
Thank you, works great!
0
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

biker9Author Commented:
Sorry about this, but I should have indicated that the columns are actually to row 84, and both solutions offered return zero if there are no values in the rows 39  to 84. So for this to work for me, we need to find nearest values in row 8 to row 84, other than zero.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
No problem. Try this Array Formula which requires confirmation with Ctrl+Shift+Enter.

=INDEX(C8:C84,MATCH(SMALL(IF(D8:D84<>"",ABS(D8:D84-E8:E84)),COUNTIF(D8:D84,0)+1),ABS(D8:D84-E8:E84),0))

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
biker9Author Commented:
Thank again!
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome! Glad it worked as desired.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.