Using Large function based on Multiple Criteria

Dellboy

New Member
Joined
Sep 16, 2020
Messages
33
Office Version
  1. 365
Hello,

I can't seem to get a Large formula to work based on two criteria's.

I can easily get a oldest value based one value, but I'm struggling to add another. See table below;

The 227 figure is based on =LARGE(IF(B:B="Jim",D:D),1) - so it returns the oldest days old for Jim.

However, when I want to the reference number as another search criteria, I get the #NUM error and have no idea why. Formula is as follows - =LARGE(IF(B:B="Jim",IF(C:C="2020",D:D)),1).

Basically, I want to create a top 5 but have no idea why that formula does not work. Any help would be greatly appreciated.

NameReferenceDays old227Jim Days Oldest
Jim2020114#NUM!Jim and 2020 Days Oldest
Jim2021120
Jim2021227
Sam202151
Sam202047
Jim202077
Steve2021290
Steve2022198
Harry202084
Jim202179
Steve202077
Harry202257
Sam202154
Sam202041
Steve202041
Jim202140
Jim202032
Harry202223
Steve202173
 
Ok, how about
Excel Formula:
=INDEX(SORT(FILTER(Sheet2!$B$3:$F$30,(Sheet2!$D$3:$D$30="Apple")*(Sheet2!$E$3:$E$30=2021)),,-1),ROW(1:5),{5,1,2})

hmm, still returns the 360 value. Its close I'm sure, im looking to return the value from column B (name) and C (Type). So it matches to the days old 360 - but also returns the name and reference from that row so it matches.
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Top 5 Days oldNameType
360Jim2789

So would expect the values above in the table on sheet 1
 
Upvote 0
Forgot to put in the sort column
+Fluff New.xlsm
ABC
1
2360Jim2789
3330Harry5526
4329Jim2541
5329Jim1234
6315Jim5412
7
Sheet1
Cell Formulas
RangeFormula
A2:C6A2=INDEX(SORT(FILTER(Sheet2!$B$3:$F$30,(Sheet2!$D$3:$D$30="Apple")*(Sheet2!$E$3:$E$30=2021)),5,-1,),ROW(1:5),{5,1,2})
Dynamic array formulas.
 
Upvote 0
You sir are a godsend. Works. Thank you so much for this.

One final thing, how do you return blanks in a cell if you get a #ref or #calc? I normally enter - iferror "" - but not sure when to put that in the formula
 
Upvote 0
You could use
Excel Formula:
=IFERROR(INDEX(SORT(FILTER(Sheet1!$B$3:$F$30,(Sheet1!$D$3:$D$30="Apple")*(Sheet1!$E$3:$E$30=2029)),,-1),ROW(1:5),{5,1,2}),"")
but it will give you a spill range showing ""
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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