Tricky - Add an additional column MATCH to INDEX formula

thorpyuk

Well-known Member
Joined
Mar 14, 2006
Messages
1,453
Hiya,

I have a working index formula:

=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,1,0),0))

However, i current have the first 2 rows in my array as headers, and i want to match on first the top row, then the 2nd row. (currently matches top row only)#

I'm really scratching my head on this one, please can anyone help?

Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hiya,

I have a working index formula:

=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,1,0),0))

However, i current have the first 2 rows in my array as headers, and i want to match on first the top row, then the 2nd row. (currently matches top row only)#

I'm really scratching my head on this one, please can anyone help?

Thanks!
If you want to match 2 header rows to define the column then what's the condition for the match of row 2?

You have for the first row:

MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,1,0)

You might want something like...

MATCH(1,IF(INDEX(Despatches_Weekly_Total_Splice,1,0)=$J$7,IF(Despatches_Weekly_Total_Splice,2,0)="this",1)),0),...

Sometimes named ranges make things more complicated! ;)
 
Upvote 0
Hiya,

Thanks for the reply!

So...assuming i'm matching on the same criteria as row 1, do you mean this:

=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,MATCH(1,IF(INDEX(Despatches_Weekly_Total_Splice,1,0)=$J$7,IF(Despatches_Weekly_Total_Splice,2,0)=$J$7,1),0))


It gives me a #VALUE! error, so i assume it's not quite right :s
 
Upvote 0
Hiya,

Thanks for the reply!

So...assuming i'm matching on the same criteria as row 1, do you mean this:

=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,MATCH(1,IF(INDEX(Despatches_Weekly_Total_Splice,1,0)=$J$7,IF(Despatches_Weekly_Total_Splice,2,0)=$J$7,1),0))


It gives me a #VALUE! error, so i assume it's not quite right :s
Argh!

My fault. I forgot to include the INDEX function for the inner IF call.

Array entered**:

=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,MATCH(1,IF(INDEX(Despatches_Weekly_Total_Splice,1,0)=$J$7,IF(INDEX(Despatches_Weekly_Total_Splice,2,0)=$J$7,1)),0))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
 
Upvote 0
Hiya,

Thanks for the reply!

So...assuming i'm matching on the same criteria as row 1, do you mean this:

=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,LOOKUP(9.99999E+307,CHOOSE({1,2},MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,1,0),0),MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,2,0),0))))


It gives me a #VALUE! error, so i assume it's not quite right :s

I'm thinking you want to match on the first or second row if a match exists. If two instances exists the later would be picked:

Try..
=INDEX(Despatches_Weekly_Total_Splice,ROW()-6,LOOKUP(9.99999E+307,CHOOSE({1,2},MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,1,0),0),MATCH($J$7,INDEX(Despatches_Weekly_Total_Splice,2,0),0))))

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,874
Members
452,949
Latest member
Dupuhini

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