Match Multiple Criteria one exact match one nearest match

gbrew584

Board Regular
Joined
Apr 28, 2005
Messages
73
I am stumpped as to how to accomplish this task, and I am hoping someone can point me in the right direction.

I am using excel 2010. I have a worksheet called Rates, that has thre columns, "Facility", "Date" and "Rate". The column for "Facility hold the facility name, the "Date" Column holds the date the rate canged and the "Rate holds the dollar rate.

Facililty Date Rate
South Side1 07/01/13 24.00
West Side1 07/01/13 35.00
South Side1 09/01/13 29.00
North Side2 10/01/13 10.00
West Side1 10/01/13 38.00

I have another worksheet that has a customer name, the facility, and the month the purchase is made.
(all customer purcases will be at the end of the month). What I am looking for is a way to match the rate with the facility and the date. The Rate would be in effect until the new rate is entered. The rate for the southside is in effect from 7/01/13 until 8/31/13.

Customer Date Facility Rate
Bob 07/31/13 Westside1 35.00 (I don't know what formula to use here)
Jerry 10/31/13 westside1 38.00
Sue 08/31/13 Southside1 24.00
Sue 09/30/13 Southside1 29.00

The facility would need to be an exact macth but the date would need to be closest(??) match. For sue I need to find the rate that is good for 8/31/13 (24.00) and the new rate for her 09/30/13 purchase.

I tired using an array Match(B1&C1,'Rate!'B1:B6&A1"A6) but that gives me bad results when the facility names start with the same letters. I'm not sure what type of fomuala I need. I've used excel a little bit but this has me stumpped. I would appriciate if someone could give me a hint as to what I should do.

Thanks, in advance!!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
See if one of the two formulas below will work for you.
You have the Facility name spelled differently in your 2 tables above.

If the names are the same in your workbooks then use the formula in cell D1.
If they are like you have them in your post try the formula in cell D8

Both are array formulas and must be enter with CTRL-SHIFT-ENTER

Excel Workbook
ABCD
1Bob7/31/2013West Side135
2Jerry10/31/2013West Side138
3Sue8/31/2013South Side124
4Sue9/30/2013South Side129
5
6
7
8Bob7/31/2013Westside135
9Jerry10/31/2013Westside138
10Sue8/31/2013Southside124
11Sue9/30/2013Southside129
Sheet2



Excel Workbook
ABC
1South Side17/1/201324
2West Side17/1/201335
3South Side19/1/201329
4North Side210/1/201310
5West Side110/1/201338
Rates
 
Upvote 0
Thank you for the reply. I was not able to get to my computer yesterday. I will give your formulas a try, today and I'll let you know how it goes. Thank you very much for your help :)
 
Upvote 0
Wow that's cool. First off, sorry for the spelling errors. The locations should be spelled the same in both worksheets. Sorry you had to go to the trouble of creating two formulas becuase of my sloppy typing.

Second, I tried your formula in D1 and I think it is working!! That is so smart, I never would have thought to use a lookup inside of the match and then use the results as an exact match, that is so cool. I am dumbfounded.

Thanks very very much. And thanks for teaching me a new trick.:)
 
Upvote 0
You're welcome. Thanks for the feedback. It works with the small sample you had, but do check on your actual data. Your rates data had the dates in an ascending order, may be a problem if dates are random.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,854
Members
449,096
Latest member
Erald

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