Mode for Text with criteria

Fazila

Board Regular
Joined
Nov 19, 2014
Messages
163
is it possible to get the mode from a column of text ignoring blank cells and where the year equals x, i.e.:

YearGrade
Year 10A
Year 10
Year 10A
Year 10B
Year 10C
Year 11A
Year 11
Year 11B
Year 11
Year 11C
Year 11B

<tbody>
</tbody>

Mode for Year 10 should be A
Mode for Year 11 should be B

This formula works, however, I can't add the Year criteria to it:

=INDEX('2013-14'!$R$2:$R$301,MODE(IF('2013-14'!$R$2:$R$301<>"",MATCH('2013-14'!$R$2:$R$301,'2013-14'!$R$2:$R$301,0))))

Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try:

=INDEX('2013-14'!$R$2:$R$301,MODE(IF('2013-14'!$Q$2:$Q$301=D2,IF('2013-14'!$R$2:$R$301<>"",MATCH('2013-14'!$R$2:$R$301,'2013-14'!$R$2:$R$301,0)))))

with Control+Shift+Enter, where the year criteria is in D2, and the years are in column Q.
 
Upvote 0
Maybe something like this...


A
B
C
D
E
1
Year​
Grade​
Year​
Mode​
2
Year 10​
A​
Year 10​
A​
3
Year 10​
Year 11​
B​
4
Year 10​
A​
5
Year 10​
B​
6
Year 10​
C​
7
Year 11​
A​
8
Year 11​
9
Year 11​
B​
10
Year 11​
11
Year 11​
C​
12
Year 11​
B​
13

Array formula in E2 copied down
=INDEX(B$2:B$12,MODE(IF(A$2:A$12=D2,IF(B$2:B$12<>"",MATCH(B$2:B$12,B$2:B$12,0)))))
Ctrl+Shift+Enter

M.
 
Upvote 0
Hi

more or less same formula. In the example in Q2:Q301 the year list. Array status.

=INDEX($R$2:$R$301,MODE(IF($R$2:$R$301<>"",IF(Q2:Q301="Year 10",MATCH($R$2:$R$301,$R$2:$R$301,0)))))


Edit: sorry: I was writing very slowly. I did not mean to overlap. Regards
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,085
Members
449,206
Latest member
ralemanygarcia

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