Dynamic range for a Mode formula?

JohannesM

New Member
Joined
Jun 3, 2015
Messages
4
Hello,

I Im trying to detirmine what article number that is most frequent in column D ,BUT with the condition that column E (week) is between 14 and 19.

Guessing that I need to implement some IF rule but don`t see how. Please save me from more fruitless hours.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Control+shift+enter, not just enter:

=MODE(IF(E2:E100>=14,IF(E2:E100<=19,D2:D100)))
 

JohannesM

New Member
Joined
Jun 3, 2015
Messages
4
Thanks a bunch, that worked perfectly and I would never had figured it out by myself! And thanks for such a fast reply, I really appreciate it alot!
Can this solution also be used to give the 2:nd most used article number?
I managed it when not using weeks as condition. What I used then was: MODE(D:D) for the most frequent and MODE(IF((D:D="")+(D:D=C44),"", D:D)) for the 2:nd most frequent, were C44 was the cell containing the result of the most frequent.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Thanks a bunch, that worked perfectly and I would never had figured it out by myself! And thanks for such a fast reply, I really appreciate it alot!
Can this solution also be used to give the 2:nd most used article number?
[...]

Row\Col
D​
E​
F​
G​
1​
interval
2​
80​
20​
14​
3​
30​
18​
19​
4​
30​
28​
mode
5​
70​
16​
30​
6​
75​
15​
75​
7​
80​
15​
8​
50​
14​
9​
30​
17​
10​
35​
22​
11​
25​
25​
12​
75​
16​
G5, control+shift+enter, not just enter, and copy down:
Rich (BB code):

=IFERROR(1/(1/MODE(IF(1-ISNUMBER(MATCH($D$2:$D$100,G$4:G4,0)),
    IF($E$2:$E$100>=G$2,IF($E$2:$E$100<=G$3,$D$2:$D$100))))),"")

Note. Referencing whole columns in array-processing formulas like the foregoing is not a good idea for reasons of efficiency.
 
Last edited:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,653
Messages
5,854,963
Members
431,689
Latest member
jacker01

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
Top