Lookup the corresponding value for a match when a cell value falls between cell dates

eagerexceler

New Member
Joined
Jan 10, 2017
Messages
36
Office Version
  1. 2016
Platform
  1. Windows
Hello, I'm trying to create a dynamic formula to dropdown, and I haven't been able to get an index match formula to work.

In sheet1 I have a list of accounts with common 'Provider' names in column A. Column B contains the corresponding 'Service Date'.
Sheet 2 has a list of rates for each common 'Provider' names in column B, and a' Service Start Date' and 'Service End Date' in columns D and E, respectively. Column C has the corresponding rate for each provider for each timeframe.

I need a formula to put in column C of sheet 1 that matches the 'Provider' name in column A of sheet1 with that of column B of sheet 2 when the date in column B of sheet1 falls within the respective start and ends dates of sheet2, and returns the corresponding rate.

Unfortunately I can't upload my sheets using XL2BB on my work computer, sorry.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Here's one solution

Book1
ABC
1ProviderService DateRate
2A15/01/2023175
3B2/05/2023225
4C13/10/2023275
5D1/03/2024350
6E1/06/2024375
Sheet1
Cell Formulas
RangeFormula
C2:C6C2=SUMPRODUCT((Sheet2!$B$2:$B$10=$A2)*($B2>=Sheet2!$D$2:$D$10)*($B2<=Sheet2!$E$2:$E$10)*Sheet2!$C$2:$C$10)


Book1
BCDE
1ProviderRateService StartService End
2A1751/01/202328/02/2023
3A2001/03/202330/04/2023
4B2251/05/202330/06/2023
5B2501/07/202331/08/2023
6C2751/09/202331/10/2023
7C3001/11/202331/12/2023
8D3251/01/202429/02/2024
9D3501/03/202430/04/2024
10E3751/05/202430/06/2024
Sheet2
 
Upvote 1
Solution
Perfect. I was indeed making it too hard. Sumproduct is underrated and I forgot about it!

Thanks friend.
 
Upvote 0

Forum statistics

Threads
1,216,562
Messages
6,131,422
Members
449,651
Latest member
Jacobs22

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