How do I output a client name based on a year range and ID code for that year?

kmprice710

Board Regular
Joined
Jan 8, 2014
Messages
87
Office Version
  1. 2019
Platform
  1. Windows
I have a bunch of clients on a list with the year they purchased the product:

ID
Year
Client
1
2005
?
2
2004
?
3
2002
?
1
2006
?

<tbody>
</tbody>

I have a list of ID codes with year ranges:

ID
From
To
Client
1
2001
2002
Barry
1
2003
2004
Barry-Elwood
1
2005
2006
Barry-Yearling
2
2001
2002
Todd
2
2003
2004
Todd-Young
3
2001
2002
Smith
3
2003
2004
Smith-Armour

<tbody>
</tbody>

How do I write a formula to output the client names given the ID code and year ranges?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have a bunch of clients on a list with the year they purchased the product:

IDYearClient
12005?
22004?
32002?
12006?

<tbody>
</tbody>

I have a list of ID codes with year ranges:

IDFromToClient
120012002Barry
120032004Barry-Elwood
120052006Barry-Yearling
220012002Todd
220032004Todd-Young
320012002Smith
320032004Smith-Armour

<tbody>
</tbody>

How do I write a formula to output the client names given the ID code and year ranges?

I tried lookup and sumproduct and couldn't get it to work. Any ideas?
 
Upvote 0
I tried lookup and sumproduct and couldn't get it to work. Any ideas?
If I'm understanding your goal correctly, assuming A1:C5 is the top table and A7:D14 is the bottom table, you can put this formula in place of the ?:
=INDEX($D$8:$D$14,IF(ISEVEN(B2),MATCH(A2&B2,$A$8:$A$14&$C$8:$C$14),MATCH(A2&B2,$A$8:$A$14&$B$8:$B$14,0)))
It has to be an array formula, so while still in the cell, press Ctrl+Shift+Enter which will result in this:
{=INDEX($D$8:$D$14,IF(ISEVEN(B2),MATCH(A2&B2,$A$8:$A$14&$C$8:$C$14),MATCH(A2&B2,$A$8:$A$14&$B$8:$B$14,0)))}
 
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,639
Members
449,325
Latest member
Hardey6ix

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