Finding a number 10 less than the highest rating number, in a specific date and time range.

Moggsy85

New Member
Joined
Sep 8, 2021
Messages
30
Office Version
  1. 2011
Platform
  1. MacOS
Hi

A user kindly provided me with the formula in the image below (=IF(J3=AGGREGATE(15,6,J$2:J$17/((A$2:A$17=A3)*(C$2:C$17=C3)),1),1,""), which highlights the lowest rating in a specific time and date.

However, I am now looking to see if i can add something to it. I want to find the lowest rating within the time and date, but i would like the rating to be a minimum of 10 less than the highest rating?

So for example in the image where L14 was selected as it was the lowest of the 3 ratings, I would like that to have NOT been highlighted as it is not a minimum of 10 less than the highest rating in that time and date.

Many thanks
 

Attachments

  • Screenshot 2022-04-24 at 17.02.40.png
    Screenshot 2022-04-24 at 17.02.40.png
    208.6 KB · Views: 10

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try this...looks like this is an extension from thread:
...which is where I obtained the source table and Peter's initial formula for the Lowest Rating.
Book1
ACJLM
1DateTimeRBD RatingLOWEST RatingLowest AND min of 10 less than MAX
22-Sep-211:00:00109  
32-Sep-211:00:009411
42-Sep-211:00:00102  
52-Sep-211:15:00157  
62-Sep-211:15:002011
72-Sep-211:15:00107  
82-Sep-211:30:001011
92-Sep-211:30:00117  
102-Sep-211:30:00105  
112-Sep-211:30:001011
122-Sep-211:45:00153  
132-Sep-211:45:00158  
142-Sep-211:45:001521 
152-Sep-212:00:0010211
162-Sep-212:00:00112  
172-Sep-212:00:00104  
Sheet1
Cell Formulas
RangeFormula
L2:L17L2=IF(J2=AGGREGATE(15,6,J$2:J$17/((A$2:A$17=A2)*(C$2:C$17=C2)),1),1,"")
M2:M17M2=IF(AND(J2=AGGREGATE(15,6,$J$2:$J$17/(($A$2:$A$17=$A2)*($C$2:$C$17=$C2)),1),J2<=AGGREGATE(14,6,$J$2:$J$17/(($A$2:$A$17=$A2)*($C$2:$C$17=$C2)),1)-10),1,"")
 
Upvote 0
Solution
Try this...looks like this is an extension from thread:
...which is where I obtained the source table and Peter's initial formula for the Lowest Rating.
Book1
ACJLM
1DateTimeRBD RatingLOWEST RatingLowest AND min of 10 less than MAX
22-Sep-211:00:00109  
32-Sep-211:00:009411
42-Sep-211:00:00102  
52-Sep-211:15:00157  
62-Sep-211:15:002011
72-Sep-211:15:00107  
82-Sep-211:30:001011
92-Sep-211:30:00117  
102-Sep-211:30:00105  
112-Sep-211:30:001011
122-Sep-211:45:00153  
132-Sep-211:45:00158  
142-Sep-211:45:001521 
152-Sep-212:00:0010211
162-Sep-212:00:00112  
172-Sep-212:00:00104  
Sheet1
Cell Formulas
RangeFormula
L2:L17L2=IF(J2=AGGREGATE(15,6,J$2:J$17/((A$2:A$17=A2)*(C$2:C$17=C2)),1),1,"")
M2:M17M2=IF(AND(J2=AGGREGATE(15,6,$J$2:$J$17/(($A$2:$A$17=$A2)*($C$2:$C$17=$C2)),1),J2<=AGGREGATE(14,6,$J$2:$J$17/(($A$2:$A$17=$A2)*($C$2:$C$17=$C2)),1)-10),1,"")
Hi, the formula works perfectly, but lets say I add a filter that takes out any rating under 100, when i add the formula it still calculates those ratings i filtered out? IS there a way around this?
 
Upvote 0
That's a different matter. Most functions will use all values in a specified range, but there are some that will operate only on visible cells after an autofilter is applied (e.g., SUBTOTAL). One approach is to build the capacity for a filter directly into the formula, as shown in the yellow filter input cells and column N.
MrExcel_20220424.xlsx
ACJLMN
1use vals >=100
2DateTimeRBD RatingLOWEST RatingLowest AND min of 10 less than MAXLowest AND min of 10 less than MAX on filtering ratings
32-Sep-211:00:00109   
42-Sep-211:00:009411 
52-Sep-211:00:00102   
62-Sep-211:15:00157   
72-Sep-211:15:002011 
82-Sep-211:15:00107  1
92-Sep-211:30:001011 
102-Sep-211:30:00117   
112-Sep-211:30:00105  1
122-Sep-211:30:001011 
132-Sep-211:45:00153   
142-Sep-211:45:00158   
152-Sep-211:45:001521  
162-Sep-212:00:00102111
172-Sep-212:00:00112   
182-Sep-212:00:00104   
Sheet1
Cell Formulas
RangeFormula
L3:L18L3=IF(J3=AGGREGATE(15,6,J$3:J$18/((A$3:A$18=A3)*(C$3:C$18=C3)),1),1,"")
M3:M18M3=IF(AND(J3=AGGREGATE(15,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)),1),J3<=AGGREGATE(14,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)),1)-10),1,"")
N3:N18N3=IF(AND(J3=AGGREGATE(15,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)*($J$3:$J$18>=$N$1)),1),J3<=AGGREGATE(14,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)*($J$3:$J$18>=$N$1)),1)-10),1,"")
 
Upvote 0
That's a different matter. Most functions will use all values in a specified range, but there are some that will operate only on visible cells after an autofilter is applied (e.g., SUBTOTAL). One approach is to build the capacity for a filter directly into the formula, as shown in the yellow filter input cells and column N.
MrExcel_20220424.xlsx
ACJLMN
1use vals >=100
2DateTimeRBD RatingLOWEST RatingLowest AND min of 10 less than MAXLowest AND min of 10 less than MAX on filtering ratings
32-Sep-211:00:00109   
42-Sep-211:00:009411 
52-Sep-211:00:00102   
62-Sep-211:15:00157   
72-Sep-211:15:002011 
82-Sep-211:15:00107  1
92-Sep-211:30:001011 
102-Sep-211:30:00117   
112-Sep-211:30:00105  1
122-Sep-211:30:001011 
132-Sep-211:45:00153   
142-Sep-211:45:00158   
152-Sep-211:45:001521  
162-Sep-212:00:00102111
172-Sep-212:00:00112   
182-Sep-212:00:00104   
Sheet1
Cell Formulas
RangeFormula
L3:L18L3=IF(J3=AGGREGATE(15,6,J$3:J$18/((A$3:A$18=A3)*(C$3:C$18=C3)),1),1,"")
M3:M18M3=IF(AND(J3=AGGREGATE(15,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)),1),J3<=AGGREGATE(14,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)),1)-10),1,"")
N3:N18N3=IF(AND(J3=AGGREGATE(15,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)*($J$3:$J$18>=$N$1)),1),J3<=AGGREGATE(14,6,$J$3:$J$18/(($A$3:$A$18=$A3)*($C$3:$C$18=$C3)*($J$3:$J$18>=$N$1)),1)-10),1,"")
THank you so much, And just out of interest, if i was to look for the highest rating instead of the lowest, how would i adapt this formula?
=IF(AQ2=AGGREGATE(15,6,AQ$2:AQ$111000/((A$2:A$111000=A2)*(H$2:H$111000=h2)),1),1,"")
 
Upvote 0
Changing the 15 to a 14...as in AGGREGATE(14...will return the largest value in the array found in the 3rd argument of the AGGREGATE function.
 
Upvote 0

Forum statistics

Threads
1,215,034
Messages
6,122,782
Members
449,095
Latest member
m_smith_solihull

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