help with lookup

BrutalLogiC

Active Member
Joined
Feb 26, 2006
Messages
267
Office Version
  1. 2016
Platform
  1. Windows
hi I am trying to work out a formula for the cells in yellow to return the Rate from the schedule of rates based on the selection of (1) department (2) resource and (3) rate type.

e.g.
if I select Dept1, Resource 1 and Monthly, the rate should be 10,000 in cell I5
if I select Dept2, Resource 5 and Daily, the rate should be 98 in cell I9

I haven't posted the full 'schedule of rates' range as it's a bit large but there are 10 departments, 10 resources and 3 rate types. The rates for each resource are the same regardless of the department but they might change so that's why I have the department column. Hope I am not over complicating it.... if I only had 1 rate type I think easier but I can't work out how to cope with 3

Service Pricing Calculator.xlsx
BCFGI
4NoDepartmentResourceRate TypeRate
51Dept1Resource 1Monthly
6Resource 3 Daily
7Resource 7 Hourly
82Dept2Resource 1Monthly
9Resource 5 Daily
10
113Dept3Resource 1Monthly
12Resource 4 Daily
13Resource 2 Hourly
144Dept4Resource 7Monthly
15
16
Pricing
Cells with Data Validation
CellAllowCriteria
C5:C31List=Resources!$I$7:$I$11
F5:F31List=Resources!$K$7:$K$16
G5:G31List=Resources!$M$7:$M$9


Service Pricing Calculator.xlsx
BCDEF
4Schedule of Rates
5Rate Type
6DepartmentResourceMonthlyDailyHourly
7Dept1Resource 110,00043554
8Dept1Resource 212,00052265
9Dept1Resource 314,00060976
10Dept1Resource 416,00069687
11Dept1Resource 518,00078398
12Dept1Resource 65,00021727
13Dept1Resource 76,00026133
14Dept1Resource 87,00030438
15Dept1Resource 98,00034843
16Dept1Resource 109,00039149
17Dept2Resource 110,00043554
18Dept2Resource 212,00052265
19Dept2Resource 314,00060976
20Dept2Resource 416,00069687
21Dept2Resource 518,00078398
22Dept2Resource 65,00021727
23Dept2Resource 76,00026133
24Dept2Resource 87,00030438
25Dept2Resource 98,00034843
26Dept2Resource 109,00039149
27Dept3Resource 110,00043554
28Dept3Resource 212,00052265
29Dept3Resource 314,00060976
Resources
Cell Formulas
RangeFormula
E7:E29E7=D7/$D$3
F7:F29F7=E7/$E$3
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
When you say you hope you are not overcomplicating things, the items that make it more complicated are:-
  • In Pricing not having the Department reference on every line
    To overcome this I added a helper column to put Dept on every line
  • In Pricing when I downloaded the XL2BB the Rate Types Daily & Hourly had leading and trailing spaces.
    To overcome this I added a Trim statement to the Column G lookup value
Using the above if you have access to the new Xlookup, this should work.

20210401 Multi Criteria Lookup.xlsx
ABCDEFGHIJ
1NoDepartmentResourceRate TypeRepeat DeptRate
21Dept1Resource 1MonthlyDept110000
3Resource 3 Daily Dept1609
4Resource 7 Hourly Dept132.4
52Dept2Resource 1MonthlyDept210000
6Resource 5 Daily Dept2783
7Dept2 
83Dept3Resource 1MonthlyDept310000
9Resource 4 Daily Dept3 
10Resource 2 Hourly Dept364.8
114Dept4Resource 7MonthlyDept4 
12
Pricing
Cell Formulas
RangeFormula
H2:H11H2=IF(LEFT(C2,4)="Dept",C2,H1)
I2:I11I2=IFERROR(XLOOKUP(1,(Resources!$C$7:$C$29=F2)*(Resources!$B$7:$B$29=H2),XLOOKUP(TRIM(G2),Resources!$D$6:$F$6,Resources!$D$7:$F$29)),"")
 
Upvote 0
hi Alex thanks for reply but sadly xlookup/office365 is something I don't have, i look at envy at this formula..?

I can add the "Dept1" or equivalent to each row if that makes it easier

Not sure why there are leading and trailing spaces, maybe because the data on the Pricing sheet is coming from a dropdown list? on my version there are no spaces...
 
Upvote 0
Here is a SumIfs alternative.

20210401 Multi Criteria Lookup.xlsx
ABCDEFGHIJ
1NoDepartmentResourceRate TypeRepeat DeptRate
21Dept1Resource 1MonthlyDept110000
3Resource 3 Daily Dept1609
4Resource 7 Hourly Dept132.4
52Dept2Resource 1MonthlyDept210000
6Resource 5 Daily Dept2783
7Dept2 
83Dept3Resource 1MonthlyDept310000
9Resource 4 Daily Dept30
10Resource 2 Hourly Dept364.8
114Dept4Resource 7MonthlyDept40
12
Pricing
Cell Formulas
RangeFormula
H2:H11H2=IF(LEFT(C2,4)="Dept",C2,H1)
I2:I11I2=IFERROR( SUMIFS( INDEX(Resources!$D$7:$F$29,0,MATCH(TRIM(G2),Resources!$D$6:$F$6,0)), Resources!$B$7:$B$29,H2, Resources!$C$7:$C$29,F2), "")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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