# Dynamic range for a Mode formula?

#### JohannesM

##### New Member
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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Control+shift+enter, not just enter:

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

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.

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:

Replies
1
Views
321
Replies
1
Views
187
Replies
4
Views
1K
Replies
0
Views
185
Replies
3
Views
416

Threads
1,218,812
Messages
6,144,618
Members
450,560
Latest member
afcmRamos

### 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

### 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