Double Vertical Lookup

Tennisguuy

Well-known Member
Joined
Oct 17, 2007
Messages
564
Office Version
  1. 2016
Platform
  1. Windows
I can do a regular vertical lookup but not quite sure how to do a double vertical lookup. I need to look up the state and then the county within my table to find the correct deductible. The lookup value for the state is in cell A12 and the lookup value for the county is in cell A13. The data is in cell K12:N500. The state is in column K, location is in column L, county column M and deductible column N
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
you could probably do it with a sumifs assuming there aren't any duplicates

I'm not really sure what 'location' is supposed to be.

Excel 2012
ABCDEFGHIJKLMN
12California $ 77,168.00
13Marin County State LocationCounty Deductible
14 Alaska ? Anchorage City$72,813
15 Alaska ? Matanuska-Susitna Borough$68,672
16 California ? Santa Clara County$84,895
17 California ? San Mateo County$81,657
18 California ? Marin County$77,168
19 California ? Ventura County$74,623
20 California ? Contra Costa County$74,353
21 California ? Orange County$72,293
22 California ? San Francisco County$69,894
23 California ? Placer County$68,959
24 California ? Alameda County$67,558

<tbody>
</tbody>
Sheet5

Worksheet Formulas
CellFormula
B12=SUMIFS(N14:N24,K14:K24,A12,M14:M24,A13)

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
You could do a sumproduct. Something like: =sumproduct((k12:k500=a12)*(m12:m500=a13)*(n12:n500))
 
Upvote 0
I can do a regular vertical lookup but not quite sure how to do a double vertical lookup. I need to look up the state and then the county within my table to find the correct deductible. The lookup value for the state is in cell A12 and the lookup value for the county is in cell A13. The data is in cell K12:N500. The state is in column K, location is in column L, county column M and deductible column N

Control+shift+enter, not just enter:

=IFERROR(INDEX($N$2:$N$100,MATCH(A13,IF($K$2:$K$100=A12,$M$2:$M$10),0)),0)
 
Upvote 0
Traditionally I use index/match instead of vlookup but regardless of what you use you just need to concatenate the lookup cells and the arrays something like INDEX($K$14:$N$24,MATCH($A$12&$A$13,$K$14:$K$24&$M$14:$M$24,0),4). remember to control+shift+enter.
 
Upvote 0
Can it be done without using additional key strokes like control+shift+enter
 
Upvote 0
You have to use ctrl+shift+enter for array formulas. If you don't it won't work properly.
 
Upvote 0
you can unlock the first two cells in the match however and if you have them in some sort of pattern then just drag the formula down reading the cell data and organizing it that way. Then you would only have to do that once.
 
Upvote 0
The problem with the sumproduct is in the duplicates. The lookup functions are for specific criteria. Depending on what you enter, certain function would require you use that as well with sumproduct. Especially if entered in any type of if statement or other error checking. For better lookups and ones that don't care whether it is a number or not using the index/match or vlookup/hlookup is better.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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