SUMIF with INDEX MATCH - Only the first match being returned

danhenshy23

New Member
Joined
Oct 3, 2016
Messages
38
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I am having issues with only the first match being returned when using SUMIF combined with IDEX and MATCH.

Here is an example of the formula I am using.

=SUMIF($B$2:$J$2,INDEX($R$2:$R$10,MATCH(K$2,$S$2:$S$10,0)),$B3:$J3)

Example image included below.
For Fred I would want to get 2 for USA and 4 for France, but as the formula is limiting to the first match only I am getting 2 for USA and 1 for France

How do I get around this please?
 

Attachments

  • Example.png
    Example.png
    32.8 KB · Views: 17
It looks like it should be . . .

Excel Formula:
SUM(IF(ISNUMBER(MATCH(Calculation[[#Headers],[Column1]:[Column82.]],IF(Table9[[#All],[Outcome-Reason]:[Outcome-Reason]]=Calculation[[#Headers],[Column85]],Table9[[#All],[Outcome]:[Outcome]]),0)),Calculation[@[Column1]:[Column84]]))

In any case, here's an example...

danhenshy v2.xlsm
ABCDEFGHIJKLMNOPQRST
1
2MunichDortmundLondonManchesterLiverpoolNew YorkWashingtonNiceParisGermanyEnglandUSAFranceCityCountry
30003322130624MunichGermany
40000DortmundGermany
50000LondonEngland
60000ManchesterEngland
70000LiverpoolEngland
80000New York USA
90000WashingtonUSA
100000NiceFrance
11ParisFrance
12
13
Sheet1
Cell Formulas
RangeFormula
K3:K10K3=SUM(IF(ISNUMBER(MATCH(Table1[[#Headers],[Munich]:[Paris]],IF(Table2[[#All],[Country]:[Country]]=Table1[[#Headers],[Germany]],Table2[[#All],[City]:[City]]),0)),Table1[@[Munich]:[Paris]]))
L3:L10L3=SUM(IF(ISNUMBER(MATCH(Table1[[#Headers],[Munich]:[Paris]],IF(Table2[[#All],[Country]:[Country]]=Table1[[#Headers],[England]],Table2[[#All],[City]:[City]]),0)),Table1[@[Munich]:[Paris]]))
M3:M10M3=SUM(IF(ISNUMBER(MATCH(Table1[[#Headers],[Munich]:[Paris]],IF(Table2[[#All],[Country]:[Country]]=Table1[[#Headers],[USA]],Table2[[#All],[City]:[City]]),0)),Table1[@[Munich]:[Paris]]))
N3:N10N3=SUM(IF(ISNUMBER(MATCH(Table1[[#Headers],[Munich]:[Paris]],IF(Table2[[#All],[Country]:[Country]]=Table1[[#Headers],[France]],Table2[[#All],[City]:[City]]),0)),Table1[@[Munich]:[Paris]]))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,223,705
Messages
6,173,996
Members
452,542
Latest member
Bricklin

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