LARGE Function using a date range

SarahR2908

New Member
Joined
Jan 20, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Im trying to show the Top 5 performers within a date range using the units per hour (column G)
At the moment im using the following formula (for first place) which gives the answer i need but you have to manually put in the date range.
=LARGE('Sheet 1'!$G$2:$G$60,1)
I want the user to be able to put in the to and from dates in cells B1 and D1 on another tab and the formula uses these dates to then calculate the largest within that period.

Ive tried to use a formula adapted from a MAX function but this doesnt work.
=LARGE(IF(('Sheet 1'!$B$2:$B$15000<=D1)*('Sheet 1'!$B$2:$B$15000>=B1),'Sheet 1'!$G$2:$G$15000,""))

Can anyone help?

1579513448329.png
 

Attachments

  • 1579513708195.png
    1579513708195.png
    6 KB · Views: 15
yes, you're right. you need an array formula for this

Book1
ABCDEF
1Dateper Hrs11/01/202012/01/2020
210/01/2020339165
310/01/2020278267
410/01/2020262372
510/01/20201214100
610/01/20201455104
710/01/2020217
810/01/2020132
910/01/2020345
1010/01/202071
1110/01/2020132
1211/01/2020180
1311/01/2020219
1411/01/202065
1511/01/2020144
1611/01/2020298
1711/01/202072
1811/01/2020273
1911/01/2020151
2011/01/202067
2111/01/2020182
2212/01/2020208
2312/01/2020298
2412/01/2020177
2512/01/2020250
2612/01/2020309
2712/01/2020156
2812/01/2020104
2912/01/2020191
3012/01/2020100
3112/01/2020213
Sheet1
Cell Formulas
RangeFormula
E2:E6E2{=SMALL(IF($A$2:$A$31>=$E$1,IF(($A$2:$A$31<=$F$1),$B$2:$B$31)),$D2)}
B2:B31B2=RANDBETWEEN(50,350)
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
or to modify the LARGE() formula like this

if you have 15000+ rows, the sumproduct() (non array) option should be much faster

Book1
ABCDEF
1Dateper Hrs11/01/202012/01/2020
210/01/20201531136
310/01/20201252140
410/01/20202843146
510/01/20201794155
610/01/20201315171
710/01/2020329
810/01/2020148
910/01/2020137
1010/01/2020280
1110/01/202094
1211/01/2020219
1311/01/2020140
1411/01/2020146
1511/01/2020239
1611/01/2020155
1711/01/2020350
1811/01/2020104
1911/01/2020281
2011/01/2020249
2111/01/2020177
2212/01/2020313
2312/01/2020339
2412/01/2020224
2512/01/2020319
2612/01/2020136
2712/01/2020233
2812/01/2020265
2912/01/2020171
3012/01/2020305
3112/01/2020232
Sheet2
Cell Formulas
RangeFormula
E2:E6E2=SUMPRODUCT(LARGE(($A$2:$A$31>=$E$1)*($A$2:$A$31<=$F$1)*($B$2:$B$31),COUNTIFS($A$2:$A$31,">="&$E$1,$A$2:$A$31,"<="&$F$1)-$D2))
B2:B31B2=RANDBETWEEN(50,350)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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