Need help nesting a VLookup inside an index, I think?

texaschai

New Member
Joined
Feb 4, 2014
Messages
34
Hello all,
I've got a problem with a table I set up.

Here is the reference table:
2019-202018-192017-182016-172015-162014-152013-142012-132011-122010-112009-102008-09
Division #Div NameDivision OHDivision OHDivision OHDivision OHDivision OHDivision OHDivision OHDivision OHDivision OHDivision OHDivision OHDivision OH
4050400000Dev Svcs
20.31​
19.5718.4219.4123.4521.9520.1521.3521.3519.9119.9114.82
4050600000Design
14.88​
17.8118.4417.8322.0522.9018.5014.7518.8821.2515.7112.74
4050700000Enviro
17.01​
16.7616.0316.7114.9011.709.259.0010.269.779.779.77
4050800000Const
12.47​
13.3111.0712.4515.1015.4011.857.7510.007.337.337.33
4050900000Roads
0.63​
0.520.670.950.550.450.400.480.480.430.430.43
4051000000Util
6.88​
6.886.457.638.907.255.205.005.004.384.384.38
4051100000Water Qual
10.52​
8.038.1911.3515.4014.7511.8511.7111.7111.7111.7115.80
4051200000Transpo
19.51​
14.209.5611.629.007.805.757.509.2910.867.231.25
4051300000Water Res
9.51​
13.3514.8712.008.90N/AN/AN/AN/AN/AN/AN/A
4051400000Fac Plan
9.36​
10.3120.0010.00N/AN/AN/AN/AN/AN/AN/AN/A

And on another tab, I have this information in multiple tables for quarters of the year (I have 4 tables for each FY):
2019-20Quarter 2
AmountPartner ObjectDivision & EmployeeHoursPhDivision
OH Rate
Total OH
134.00​
4051200000/D39410PW Transportation / GD REGULAR
1.00​
.0419.5119.51
171.36​
4051200000/D39415PW Transportation / GD TELECM REG
1.25​
.0419.5124.39
1,269.26​
4051200000/M01610PW Transportation / CM REGULAR
10.75​
.0419.51209.73
4,635.43​
4051200000/M01615PW Transportation / CM TELECM REG
39.00​
.0419.51760.89
4,982.78​
4050700000/S22010PW Environmental / TL REGULAR58.00.0217.01986.58

As you can see, in column B of the 2nd table, it includes a text string that contains both the Division # (as it shows in the first table), a "/", and then the employee number. What I need to do is to look up the division OH rate based on the Division # in the text string. I currently have a VLOOKUP using a LEFT formula in the Division OH Rate column in the second table, but now I need to add a column to the left of column C in the first table so I can enter the new year for the new year's quarters and it throws off every year because it's doing a VLOOKUP to the 3rd row or 4th row instead of doing a lookup by the actual year (I don't want to have to update each prior quarter's "col reference" each time I add a new year, in other words.

What I want to do is, in the 2nd table, column F (Division OH Rate) to look up the YEAR I listed in bold in cell A1 of the second table, plus look up the left side of the text string in column B of the second table, and reference the columns by year and division # in the first table to get the Division OH Rate. I know it probably will take an INDEX but I'm not sure how to do an INDEX with a "LEFT" nested into it. Any help is appreciated because I need to fix about 30 spreadsheets (one for each project) and add in the new year. I don't want to have to update each quarter going forward every time I add a year.

Hope that makes sense!
Thanks,
Charlotte
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
You should be able to do that with a single lookup like this:
=VLOOKUP(LEFT(B3,10),A3:A23,MATCH(A1,B1:M1,0))
 
Upvote 0
You should be able to do that with a single lookup like this:
=VLOOKUP(LEFT(B3,10),A3:A23,MATCH(A1,B1:M1,0))
That didn't work...
I should add that the tab in the first table is "Div OH" and the tab in the second table is "Labor OH Detail", so this is how I did the formula and it gave me "#N/A":
=VLOOKUP(LEFT(B4,10)*1,'Div OH'!C3:N12,MATCH(A$2,'Div OH'!C1:N1),0)
 
Upvote 0
Are the Divison# on the Div OH sheet text values or numbers?
 
Upvote 0
That didn't work...
I should add that the tab in the first table is "Div OH" and the tab in the second table is "Labor OH Detail", so this is how I did the formula and it gave me "#N/A":
=VLOOKUP(LEFT(B4,10)*1,'Div OH'!C3:N12,MATCH(A$2,'Div OH'!C1:N1),0)
I also just tried it with:
=VLOOKUP(LEFT(B4,10)*1,'Div OH'!A3:A12,MATCH(A$2,'Div OH'!C1:N1),0)
And that didn't work either.
 
Upvote 0
I thought that your 2nd table (where the formula is) was the Labor OH sheet & col B on that sheet cannot be numbers. :unsure:
 
Upvote 0
I thought that your 2nd table (where the formula is) was the Labor OH sheet & col B on that sheet cannot be numbers. :unsure:
The VLookup has been working just fine with one General and one Number format. I just need it to now look at the Fiscal Year and reference that column instead of me using a "reference column" such as what I have in this sample formula in bold: "=VLOOKUP(A1,Sheet1!B1:Z99,16,false)".
 
Upvote 0
See my comment No.#2 Use MATCH instead of the number 16, I assumed the year you are looking for is in A1 and the year headings are in B1 to M1, adjust as required
 
Upvote 0
See my comment No.#2 Use MATCH instead of the number 16, I assumed the year you are looking for is in A1 and the year headings are in B1 to M1, adjust as required
Still not working. :( But I'm finally jiving with what you're saying.
Here are the pics of both tabs (I copied them into a new sheet so they would match your formula almost exactly, with the same column letters). But here are pics of the actual columns, etc. and the formula (which I changed slightly... I tried two iterations of the bolded portion here... =VLOOKUP(LEFT(B3,10),'Div OH'!$A$2:$N$11,MATCH(A1,'Div OH'!C1:N1,0)) and =VLOOKUP(LEFT(B3,10),'Div OH'!$A$2:$A$11,MATCH(A1,'Div OH'!C1:N1,0)) - the latter to match your example in comment No. 2 and unfortunately neither works).

1600130087246.png


1600130121399.png


Thank you for taking a look! :)
Charlotte
 

Attachments

  • 1600130102531.png
    1600130102531.png
    121 KB · Views: 20
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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