Find a number that is between two values

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
704
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
In a sheet like that:

[TABLE="class: grid, width: 50"]
<tbody>[TR]
[TD]3
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[/TR]
[TR]
[TD]0
[/TD]
[/TR]
</tbody>[/TABLE]

How can I get retrieve the value that is >5 and <=10?

Thanks.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
like this?


Excel 2013/2016
AB
14 
24
37Y
42
54
68Y
74
810Y
97Y
103
Sheet2
Cell Formulas
RangeFormula
B1=IF(AND(A1>5,A1<=10),"Y","")
 
Upvote 0
If those values are in A1:A5, 5 is in C1 and 10 is in C2, try this Array-Formula:
Code:
=IF(MAX(IF($A$1:$A$5<=C$2, $A$1:$A$5, 0))>$C$1,MAX(IF($A$1:$A$5<=$C$2,$A$1:$A$5)),"Does not exist")
CTRL+SHIFT+ENTER
 
Upvote 0
How can I get retrieve the value that is >5 and <=10?
Could there be more than 1 value that meets the critieria?
Could there be zero values that meet the criteria?
If the answer to either of these questions is 'yes' please explain what you want returned.

If the answer to both my questions is 'No' (meaning always one and only one value) then try
=SUMIFS(A1:A5,A1:A5,">5",A1:A5,"<=10")
 
Upvote 0
Could there be more than 1 value that meets the critieria?
Could there be zero values that meet the criteria?
If the answer to either of these questions is 'yes' please explain what you want returned.

If the answer to both my questions is 'No' (meaning always one and only one value) then try
=SUMIFS(A1:A5,A1:A5,">5",A1:A5,"<=10")

Works Fine, thanks all!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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