Formula to get highest value between two numbers

aliaslamy2k

Active Member
Joined
Sep 15, 2009
Messages
416
Office Version
  1. 2019
Platform
  1. Windows
Dear Experts,

I want to formula to display the highest number in between two numbers.

Example :
1. In Cell AQ8 display highest between 30 to 45 else blank
2. In Cell AQ9 Display highest number between 10 to 30 else blank
3. In Cell AQ10 Display highest number between 0 to 10 else blank



Book1
AKALAMANAOAPAQAR
5Licence ExpirationLIC Days Remaining
618-Dec-96LIC EXPIRED
723-Apr-15LIC EXPIREDGreater ThanLess thanResultRemarks
813-Apr-17LIC EXPIRED304544To check in column AL and get the result in AQ8
919-Jul-17LIC EXPIRED103029To check in column AL and get the result in AQ9
1025-Jan-18LIC EXPIRED0109To check in column AL and get the result in AQ10
1114-Mar-18LIC EXPIRED
1216-Oct-18LIC EXPIRED
134-Nov-18LIC EXPIRED
144-Nov-18LIC EXPIRED
159-Jan-19LIC EXPIRED
162-Apr-19LIC EXPIRED
179-Jun-19LIC EXPIRED
1820-Jul-19LIC EXPIRED
1925-Jul-19LIC EXPIRED
2028-Jul-19LIC EXPIRED
2128-Jul-19LIC EXPIRED
2228-Jul-19LIC EXPIRED
2328-Jul-19LIC EXPIRED
2413-Oct-19LIC EXPIRED
2520-Oct-19LIC EXPIRED
2620-Oct-19LIC EXPIRED
2714-Nov-19LIC EXPIRED
2814-Nov-19LIC EXPIRED
295-Feb-20LIC EXPIRED
3016-Feb-20LIC EXPIRED
3119-Feb-20LIC EXPIRED
322-Mar-20LIC EXPIRED
339-Mar-20LIC EXPIRED
3418-Mar-20LIC EXPIRED
3523-Mar-20LIC EXPIRED
3623-Mar-20LIC EXPIRED
3725-Mar-201
3826-Mar-202
3926-Mar-202
4026-Mar-202
4126-Mar-202
4226-Mar-202
4326-Mar-202
4426-Mar-202
4526-Mar-202
4626-Mar-202
4726-Mar-202
4826-Mar-202
4926-Mar-202
5026-Mar-202
5126-Mar-202
5226-Mar-202
5326-Mar-202
5426-Mar-202
5526-Mar-202
5626-Mar-202
572-Apr-209
587-Apr-2014
5913-Apr-2020
6013-Apr-2020
6114-Apr-2021
6223-Apr-2030
6323-Apr-2030
6423-Apr-2030
6523-Apr-2030
6624-Apr-2031
6727-Apr-2034
6827-Apr-2034
6927-Apr-2034
704-May-2041
715-May-2042
7213-Apr-2020
7315-May-2052
7417-May-2054
7518-May-2055
7620-May-2057
7721-May-2058
7821-May-2058
7928-May-2065
809-Jun-2077
819-Jun-2077
8210-Jun-2078
8311-Jun-2079
8414-Jun-2082
8515-Jun-2083
8615-Jun-2083
8718-Jun-2086
8830-Jun-2098
8930-Jun-2098
903-Jul-20101
917-Jul-20105
9213-Jul-20111
9314-Jul-20112
9421-Jul-20119
9523-Jul-20121
9624-Jul-20122
9724-Jul-20122
9824-Jul-20122
9931-Jul-20129
1007-Aug-20136
1017-Aug-20136
10217-Aug-20146
10321-Aug-20150
10424-Aug-20153
10527-Aug-20156
10628-Aug-20157
10731-Aug-20160
1081-Sep-20161
1098-Sep-20168
1108-Sep-20168
1118-Sep-20168
1128-Sep-20168
1139-Sep-20169
11411-Sep-20171
11519-Sep-20179
11630-Sep-20190
1171-Oct-20191
1181-Oct-20191
1191-Oct-20191
1201-Oct-20191
1211-Oct-20191
1228-Oct-20198
1239-Oct-20199
12416-Oct-20206
12521-Oct-20211
12621-Oct-20211
12726-Oct-20216
12826-Oct-20216
12927-Oct-20217
1303-Nov-20224
1313-Nov-20224
1326-Nov-20227
1339-Nov-20230
13413-Nov-20234
13519-Nov-20240
13620-Nov-20241
13722-Nov-20243
13826-Nov-20247
13926-Nov-20247
14026-Nov-20247
14130-Nov-20251
14212-Dec-20263
14322-Dec-20273
14425-Dec-20276
14525-Dec-20276
14629-Dec-20280
14730-Dec-20281
1488-Jan-21290
14915-Jan-21297
15015-Jan-21297
15115-Jan-21297
15222-Jan-21304
15326-Jan-21308
15426-Jan-21308
1559-Feb-21322
1569-Feb-21322
15711-Feb-21324
15811-Feb-21324
15912-Feb-21325
16016-Feb-21329
16116-Feb-21329
16217-Feb-21330
16318-Feb-21331
16418-Feb-21331
16523-Feb-21336
16623-Feb-21336
16723-Feb-21336
1682-Mar-21343
1699-Mar-21350
17029-Dec-2020  
171Available 
172Available 
173Available 
174Available 
175Available 
176Available 
177Available 
178Available 
179Available 
180Available 
181Available 
182Available 
183Available 
184Available 
185Available 
186Available 
187Available 
188Available 
189Available 
190Available 
191Available 
192Available 
193Available 
194Available 
195Available 
196Available 
197Available 
198Available 
199Available 
200Available 
201Available 
202Available 
203Available 
204Available 
205Available 
206Available 
207Available 
208Available 
209Available 
210Available 
211Available 
212Available 
213Available 
214Available 
215Available 
216Available 
217Available 
218Available 
219Available 
220Available 
221NO 
222NO 
223NO 
224NO 
225NO 
226NO 
227NO 
228NO 
229NO 
230NO 
231NO 
232NO 
233NO 
234NO 
235NO 
236NO 
Sheet1
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How do get 44 and 29 as results from that sample data?

BTW, I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.
 
Upvote 0
How do get 44 and 29 as results from that sample data?

BTW, I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.

Hi Peter,

I just entered a random number as 44, 29 and 9.

Thank you for your suggestion, i have updated my profile
 
Upvote 0
i have updated my profile
Thanks. :)

In AQ8, copied down, try

=AGGREGATE(14,6,AL$6:AL$300/((AL$6:AL$300>AO8)*(AL$6:AL$300<AP8)),1)


Also, just checking: The data has the value 30 in column AL but the above formula does not return it in cell AQ9. That is because your description says "between" and your AP7 heading is also "Less Than" not "Less Than or Equal to".
 
Upvote 0
Thanks. :)

In AQ8, copied down, try

=AGGREGATE(14,6,AL$6:AL$300/((AL$6:AL$300>AO8)*(AL$6:AL$300<AP8)),1)


Also, just checking: The data has the value 30 in column AL but the above formula does not return it in cell AQ9. That is because your description says "between" and your AP7 heading is also "Less Than" not "Less Than or Equal to".

Hi Peter,

Thank you so much. This formula works perfectly fine. I have added IFERROR in this formula to show as blank instead of #NUM

Book1
AOAPAQ
7Greater ThanLess thanResult
8304541
9103021
100109
Sheet1


Thank you once again
 
Upvote 0
Hello Peter,

Is there any formula to get the list of vehicle numbers whiich falls under those criteria. Vehicle numbers are in column E6:E300
 
Upvote 0
Could you clarify that by constructing a small set of dummy data and expected results and posting with XL2BB? (you can hide irrelevant columns)
 
Upvote 0
I am unable to copy whole table due to character limitations in XL2BB, so i have to delete few columns to reduce the size


Excel Formulas.xlsx
DEFGHIJKLMNOP
1Greater thanLess thanResults
23045 1st Reminder
31030 2nd Reminder
4010 Last Reminder
5IDVehicle NumberLIC Days Remaining
617823 30 - 45 10 - 30 0 - 10
7254705 Vehicle NumberLIC Days RemainingVehicle NumberLIC Days RemainingVehicle NumberLIC Days Remaining
8334346 24076730264881143200551
94116609 28359730104516204551012
105570242 31485230305660202168302
116633595 31220930127539212157972
12715305 25394331718771202142182
138140236 46242343067962
14915257 320296343051142
151049148 320295345564922
1611232690 168467413072422
171223298 34163423069242
181341204 3075242
191442990 3065582
2015186324 3050932
211641205 3051942
221741207 3054552
231841208 3057122
241929555 3051962
252046963 3071192
262146962 2067562
2722283779 3064152
2823283780 2634439
2924254273 
3025739050 
3126668344 
3227594941 
3328460470 
3429264925 
3530283761 
3631283760 
3732320055 
3833455101 
3934216830 
4035215797 
4136214218 
4237306796 
4338305114 
4439556492 
4540307242 
4641306924 
4742307524 
4843306558 
4944305093 
5045305194 
5146305455 
5247305712 
5348305196 
5449307119 
5550206756 
5651306415 
5752263443 
5853264881 
5954104516 
6055305660 
6156127539 
6257240767 
6358283597 
6459314852 
6560312209 
6661253943 
676246242 
6863320296 
6964320295 
7065168467 
716634163 
7267718771 
7368266580 
7469211949 
7570159021 
Sheet1 (2)
 
Upvote 0
So what are the items on that screen shot that you are looking for help with and how are they arrived at manually?
 
Upvote 0

Forum statistics

Threads
1,215,450
Messages
6,124,912
Members
449,195
Latest member
Stevenciu

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