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.
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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,201
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:

Watch MrExcel Video

Forum statistics

Threads
1,122,521
Messages
5,596,653
Members
414,083
Latest member
Mrsash

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