keepcalculator

06 Numbers and Powers

Smallest 3 Values with Criteria: How to Find Them

Card No. 06·54843 · Updated · Standard formula, shown below

The calculator on this card is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

This calculator finds the three smallest values in a list that meet a condition you set, such as being above a threshold, below a limit, or within a range. You enter your numbers and the criteria, and it returns the three smallest qualifying values in ascending order. If fewer than three values meet the criteria, it shows only those that do.

Formula

The calculator sorts the list in ascending order and then filters out any values that fall below the minimum threshold or above the maximum threshold. The three smallest values from the filtered list are returned. If the list has fewer than three qualifying values, the missing ones are shown as 0.

Let L be the list of numbers, min the lower bound, and max the upper bound. The qualifying set is:

Q = {x ∈ L : min ≤ x ≤ max}

The output is the three smallest elements of Q, sorted ascending. If |Q| < 3, the remaining outputs are 0.

Worked Example

Using the default list 12, 5, 8, 3, 10, 1, 7, 2 with min = 0 and max = 100:

  1. Sort the list: 1, 2, 3, 5, 7, 8, 10, 12
  2. All values are between 0 and 100, so the filtered list is the same.
  3. The three smallest are 1, 2, and 3.

The calculator outputs 1, 2, 3.

When to Use This Calculator

You might need the three smallest values that satisfy a condition in many real situations:

  • Quality control: Find the three lowest defect rates among products that meet a minimum sample size.
  • Finance: Identify the three cheapest stocks in a portfolio that are above a certain price threshold.
  • Sports: Determine the three fastest qualifying times in a race, but only among runners who finished.
  • Data cleaning: Spot the smallest outliers in a dataset while ignoring values that are too small to be realistic.

The criteria (min and max) let you exclude values that are not relevant, so you are not just picking the absolute smallest numbers but the smallest numbers that actually matter for your question.

How to Read the Results

The three outputs are labeled 1st, 2nd, and 3rd smallest. They are always in ascending order, so the first output is the smallest qualifying value, the second is the next, and so on. If a value is 0, it means there were not enough qualifying numbers to fill that position. For example, if your list is 5, 9, 12 and your criteria are min = 10, max = 20, only 12 qualifies, so the 1st smallest is 12 and the 2nd and 3rd are 0.

If you set min or max to a value that makes no qualifying values, all outputs become 0. That is your signal to loosen the criteria.

Common Mistakes and How to Avoid Them

  • Forgetting to sort: The calculator sorts for you, but if you are doing it by hand, always sort first. The three smallest are not necessarily in the order they appear in the list.
  • Mixing up min and max: The min is the lower bound (values below it are excluded), and max is the upper bound (values above it are excluded). Swap them and you will get no results.
  • Using negative numbers: If your data can be negative, set min to a negative number (e.g., -100) and max to a positive one. The default min is 0, which excludes negatives.
  • Assuming exactly three results: If your filtered list has fewer than three numbers, the calculator shows 0 for the missing ones. That is not an error; it just means your criteria are too strict.

Limitations of the Formula

This calculator works with a simple list of numbers. It does not handle:

  • Text or categories: You cannot enter words; only numeric values are accepted.
  • Multiple criteria beyond a range: If you need to filter by more than just a numeric range (e.g., only values from a certain date), you would need to pre-filter your list.
  • Duplicate handling: If the same value appears multiple times, it is counted each time. For example, the list 2, 2, 3 gives 2, 2, 3. If you want unique values, remove duplicates first.
  • Very large lists: The calculator can handle up to 100,000 numbers, but extremely large lists may take a moment. For most everyday use, this is more than enough.

Alternatives and Related Calculations

If you need more than the three smallest values, you can use the same approach with a different count. For example, to find the five smallest, just extend the logic. If you need the three largest, sort descending instead. If you need the median or average of the smallest three, you can compute those after finding the values.

In spreadsheet software like Excel or Google Sheets, you can achieve the same result using the SMALL function combined with an array formula that applies the criteria. For instance, SMALL(IF((range>=min)*(range<=max),range),1) gives the smallest qualifying value. But this calculator gives you the answer without needing to set up array formulas.

Frequently Asked Questions

What if my list has negative numbers?

Set the minimum threshold to a negative number, like -1000, and the maximum to a positive number. The default min is 0, which would exclude all negatives. For example, with list -5, 3, 8 and min = -10, max = 10, the three smallest are -5, 3, 8.

Can I find the three smallest values without any criteria?

Yes, just set min to 0 (or the lowest possible value) and max to a very large number like 1,000,000. Then the calculator will return the three smallest numbers in the list regardless of their size.

What does a 0 output mean?

A 0 in the 2nd or 3rd smallest output means there were not enough values that met your criteria. For example, if only two numbers are above the minimum threshold, the 3rd smallest will be 0. It does not mean zero is actually in your data.

How do I find the three smallest unique values?

Remove duplicates from your list before entering it. For example, if your list is 1, 1, 2, 3, enter 1, 2, 3 to get 1, 2, 3 as the three smallest unique values.

Can I use decimal numbers?

Yes, the calculator accepts decimals. For example, 1.5, 2.7, 0.9 with min = 0 and max = 10 gives 0.9, 1.5, 2.7.

What if I need the three smallest values that are above a certain number but also below another?

That is exactly what this calculator does. Set the minimum threshold to the lower bound and the maximum threshold to the upper bound. Only values in that range are considered.

Related

Formula used
in list | Data list | - | 12, 5, 8, 3, 10, 1, 7, 2 | 0 | 100000
in min | Minimum threshold | - | 0 | 0 | 100000
in max | Maximum threshold | - | 100 | 0 | 100000
out v1 | 1st smallest | - | if(count(list) > 0 and minl(list) >= min and maxl(list)  1 and minl(list) >= min and maxl(list)  2 and minl(list) >= min and maxl(list)

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →