Index with multiple matches (verticle & horizontal)

cshetty

Board Regular
Joined
Apr 15, 2017
Messages
87
Office Version
  1. 2016
Platform
  1. Windows
Dear Experts
Please help me to tune this formula.

=INDEX($F$4:$M$10,MATCH(1,($E15=$D$4:$D$10)*(F$14=$E$4:$E$10),0),MATCH(1,($D15=$F$3:$M$3),0))

Data layout image attached.

Thank you in advance.
 

Attachments

  • Index Match.jpg
    Index Match.jpg
    90.6 KB · Views: 12

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Book1
ABCDEFGHIJ
1Data
2HotelRevenue Type20162017201820192022202320252025
3Hotel1Room Revenue22490202852135286713824853901849791191769622058102297750
4Hotel1F&B Revenue -Total38399613717726366047336477242652356283232731680983696147
5Hotel1Others1020865125206611311199432.22690838712683758333849983
6Hotel1NOP11612911678180155941113970261092964112377214237071628732
7Hotel2Room Revenue28305862884414283544125171921762052182056815136731700501
8Hotel2F&B Revenue -Total28933922818648288662426397262113070208682719663062040472
9Hotel2Others619152684913702274658191603993624001643444642028
10
11Result
12YearHotelRoom RevenueF&B Revenue -TotalOthers
132016Hotel1224902038399611020865
142016Hotel228305862893392619152
152017Hotel1285213537177261252066
162017Hotel228844142818648684913
Sheet2
Cell Formulas
RangeFormula
C13:E16C13=SUMIFS(INDEX($C$3:$J$9,,MATCH($A13,$C$2:$J$2,0)),$A$3:$A$9,$B13,$B$3:$B$9,C$12)



copy across and down
 
Upvote 0
Please help me to tune this formula.

=INDEX($F$4:$M$10,MATCH(1,($E15=$D$4:$D$10)*(F$14=$E$4:$E$10),0),MATCH(1,($D15=$F$3:$M$3),0))
To tune your formula, try this very small change (in your version you may need to confirm it with Ctrl+Shift+Enter, not just Enter)
=INDEX($F$4:$M$10,MATCH(1,($E15=$D$4:$D$10)*(F$14=$E$4:$E$10),0),MATCH(1,--($D15=$F$3:$M$3),0))
 
Upvote 0
Solution
To tune your formula, try this very small change (in your version you may need to confirm it with Ctrl+Shift+Enter, not just Enter)
=INDEX($F$4:$M$10,MATCH(1,($E15=$D$4:$D$10)*(F$14=$E$4:$E$10),0),MATCH(1,--($D15=$F$3:$M$3),0))
Thank you Peter. You were helping me often.
 
Upvote 0
You're welcome. Glad to help. Thanks for the follow-up. :)
 
Upvote 0
C13=IFERROR(INDEX($C$3:$J$9,MATCH($B13&C$12,INDEX($A$3:$A$9&$B$3:$B$9,0),0),MATCH($A13,$C$2:$J$2,0)),"")

Copy across and down
 
Upvote 0
Book1
ABCDEFGHIJ
1Data
2HotelRevenue Type20162017201820192022202320252025
3Hotel1Room Revenue22490202852135286713824853901849791191769622058102297750
4Hotel1F&B Revenue -Total38399613717726366047336477242652356283232731680983696147
5Hotel1Others1020865125206611311199432.22690838712683758333849983
6Hotel1NOP11612911678180155941113970261092964112377214237071628732
7Hotel2Room Revenue28305862884414283544125171921762052182056815136731700501
8Hotel2F&B Revenue -Total28933922818648288662426397262113070208682719663062040472
9Hotel2Others619152684913702274658191603993624001643444642028
10
11Result
12YearHotelRoom RevenueF&B Revenue -TotalOthers
132016Hotel1224902038399611020865
142016Hotel228305862893392619152
152017Hotel1285213537177261252066
162017Hotel228844142818648684913
Sheet2
Cell Formulas
RangeFormula
C13:E16C13=SUMIFS(INDEX($C$3:$J$9,,MATCH($A13,$C$2:$J$2,0)),$A$3:$A$9,$B13,$B$3:$B$9,C$12)



copy across and down
C13=IFERROR(INDEX($C$3:$J$9,MATCH($B13&C$12,INDEX($A$3:$A$9&$B$3:$B$9,0),0),MATCH($A13,$C$2:$J$2,0)),"")

Copy across and down
Thank you very much.
This eliminates C+S+E
 
Upvote 0
C13=IFERROR(INDEX($C$3:$J$9,MATCH($B13&C$12,INDEX($A$3:$A$9&$B$3:$B$9,0),0),MATCH($A13,$C$2:$J$2,0)),"")

Copy across and down
Hi. One question. When we use index function as a stand alone function the syntax would be Index(range, row, col). Why we use row number as ZERO when we use Index function inside other function ? In the above case Index is inside match function and the crow reference is zero. Could you please enlighten on this.

Hope i was able to form the question correctly.

Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,224,821
Messages
6,181,163
Members
453,021
Latest member
Justyna P

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