Array formula with INDEX, MODE, MATCH - clairification needed

marc01

Board Regular
Joined
Sep 17, 2018
Messages
50
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I am using an array formula to show me the most frequently occuring event based on a set criteria. For context, I am looking at points in tennis and wanting to know if a player serves in a certain direction, are they more often or not in an attacking, neutral, or defensive position for their subsequent shot.

The array formula I am using is:

{=(INDEX(Table4[Serve+1],MODE(IF(Table4[Serve+1]<>"",IF(Table4[Serve+1]<>"N/A",IF(Table4[1st serve]=E8,IF(Table4[Week]=Report!B2,IF(Table4[Player]=Report!B3,IF(Table4[Side]="Deuce",(MATCH(Table4[Serve+1],Table4[Serve+1],{0,0})))))))))))}

The answer to the question is attacking = 1, neutral = 0, defensive = 0. With the above formula this is working.......

However, there are instances where there may be a tie between the values recorded e.g. attacking =1, neutral = 1, and defensive =0. When using {0,0} the formula will choose one of the two and display it. When I change {0,0} to 0 this return the error #N/A. For this instance by wrapping the formula in IFERROR i am able to state "there has been a tie"........BUT for some reason when I do this for the above formula where I know the answer should be attacking (as it has 1 occurence, and neutral and defensie have 0 occurrences) it returns an error value.

Does anyone know why this may be the case? Wondering if it something to do with there only being 1 occurence of a value as it appears to be working if the answer is attacking = 2, neutral = 0, and defensive = 0...

Many thanks in advance,

Marc
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You can't have a modal value with a single occurrence, see if this alternative way works (thanks to Eric W for this method).

=(INDEX(Table4[Serve+1],MODE(IF(Table4[Serve+1]<>"",IF(Table4[Serve+1]<>"N/A",IF(Table4[1st serve]=E8,IF(Table4[Week]=Report!B2,IF(Table4[Player]=Report!B3,IF(Table4[Side]="Deuce",(MATCH(Table4[Serve+1],Table4[Serve+1],0)*{1,1}))))))))))
 
Upvote 0
You can't have a modal value with a single occurrence, see if this alternative way works (thanks to Eric W for this method).

=(INDEX(Table4[Serve+1],MODE(IF(Table4[Serve+1]<>"",IF(Table4[Serve+1]<>"N/A",IF(Table4[1st serve]=E8,IF(Table4[Week]=Report!B2,IF(Table4[Player]=Report!B3,IF(Table4[Side]="Deuce",(MATCH(Table4[Serve+1],Table4[Serve+1],0)*{1,1}))))))))))
 
Upvote 0
Great Jason thank you very much for this. I will give it a try. All the best. Marc
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,448
Members
448,966
Latest member
DannyC96

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