Index Match with 3 Criteria

lai_arceo

New Member
Joined
Apr 7, 2010
Messages
38
I want to generate data on my table (Rpt) based on 3 criteria from another sheet (DB). I got the first column working fine with an index match function but when I copy the formula in the next cell, it generates an #N/A error. Can someone help me with this please? Thank you in advance!

Sample sheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBX
1353535353535353535353535353535363636363636363636363636363636373737373737373737373737373737383838383838383838383838383838393939393939393939393939393939
2GrpABCDEFGHIJKLMN*'ABCDEFGHIJKLMN*'ABCDEFGHIJKLMN*'ABCDEFGHIJKLMN*'ABCDEFGHIJKLMN*'
31-1000000200000000000000200000000000000200000000000000200000000000000200000000
41-2040000700000000040100700000000000000800000000000000800000000000000800000000
51-3000000300000000030000000000000000000200000001000000200000000000000200000000
61-4020000100000000020000100000000000000100000000000000100000000000000100000000
71-5000000100000001010000100000000000100100000000010000100000000000000100000000
81-6000000200000000000000200000000000000200000000000000200000000000000200000000
91-7010000100000000000000100000000000000100000000000000100000000000000100000000
101-8000000000000000000000000000000000000000000000000000000000000000000000000000
DB


Sample sheet.xlsx
ABCDEFGHIJKLMNO
1WEEK 35
2GrpABCDEFGHIJKLMN
31-10#N/A
Rpt
Cell Formulas
RangeFormula
B3:C3B3=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!A3:A96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(B$2,DB!$B$2:$BX$2,0))
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
so when you copy
=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!A3:A96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(B$2,DB!$B$2:$BX$2,0))

to the next column , it will become
DB!B3:B96,0 in the MATCH part

=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!B3:B96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(B$2,DB!$B$2:$BX$2,0))

Every thing else is FIXED

is that now the new column of data you now want to match
instead of
MATCH($A3,DB!A3:A96,0)
you are using
MATCH($A3,DB!B3:B96,0)
 
Upvote 0
so when you copy
=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!A3:A96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(B$2,DB!$B$2:$BX$2,0))

to the next column , it will become
DB!B3:B96,0 in the MATCH part

=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!B3:B96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(B$2,DB!$B$2:$BX$2,0))

Every thing else is FIXED

is that now the new column of data you now want to match
instead of
MATCH($A3,DB!A3:A96,0)
you are using
MATCH($A3,DB!B3:B96,0)

I have corrected my formula as follows:

Sample sheet.xlsx
ABCDEFGHIJKLMNO
1WEEK 35
2GrpABCDEFGHIJKLMN
31-10#REF!
41-2
51-3
61-4
71-5
81-6
91-7
101-8
Rpt
Cell Formulas
RangeFormula
B3B3=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!$A$3:$A$96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(B$2,DB!$B$2:$BX$2,0))
C3C3=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!A3:A96,0),MATCH($I$1,DB!$B$1:$BX$1,0),MATCH(C$2,DB!$B$2:$BX$2,0))


I do not know why when I copy that to the next cell, it generates a #REF error.
 
Upvote 0
try
=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!$A$3:$A$96,0),MATCH($I$1&B$2,DB!$B$1:$BX$1&DB!$B$2:$BX$2,0))

Book1
ABCDEFGHIJKLMNOP
1WEEK 36
2GrpABCDEFGHIJKLMN
31-1A36B36C360002
Sheet2
Cell Formulas
RangeFormula
B3:H3B3=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!$A$3:$A$96,0),MATCH($I$1&B$2,DB!$B$1:$BX$1&DB!$B$2:$BX$2,0))


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1353535353535353535353535353535363636363636363636363636363636
2GrpABCDEFGHIJKLMN*'ABCDEFGHIJKLMN*'
31-1121410025300200000000A36B36C36000200000000
41-Feb040000700000000040100700000000
51-Mar000000300000000030000000000000
61-Apr020000100000000020000100000000
71-May000000100000001010000100000000
81-Jun000000200000000000000200000000
91-Jul010000100000000000000100000000
101-Aug000000000000000000000000000000
DB



will only be on the dropbox share for a few days
 
Upvote 1
Solution
try
=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!$A$3:$A$96,0),MATCH($I$1&B$2,DB!$B$1:$BX$1&DB!$B$2:$BX$2,0))

Book1
ABCDEFGHIJKLMNOP
1WEEK 36
2GrpABCDEFGHIJKLMN
31-1A36B36C360002
Sheet2
Cell Formulas
RangeFormula
B3:H3B3=INDEX(DB!$B$3:$BX$96,MATCH($A3,DB!$A$3:$A$96,0),MATCH($I$1&B$2,DB!$B$1:$BX$1&DB!$B$2:$BX$2,0))


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1353535353535353535353535353535363636363636363636363636363636
2GrpABCDEFGHIJKLMN*'ABCDEFGHIJKLMN*'
31-1121410025300200000000A36B36C36000200000000
41-Feb040000700000000040100700000000
51-Mar000000300000000030000000000000
61-Apr020000100000000020000100000000
71-May000000100000001010000100000000
81-Jun000000200000000000000200000000
91-Jul010000100000000000000100000000
101-Aug000000000000000000000000000000
DB



will only be on the dropbox share for a few days
You are amazing! This works! Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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