# tablepress/3.4/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Minimum.php

TablePress – Tables in WordPress made easy, version 3.4. 90 lines.

- Page: https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Minimum.php
- Raw: https://pluginprobe.com/plugins/tablepress/3.4/raw/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Minimum.php
- Modified: 2026-02-17T04:58:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tablepress/3.4/code/libraries/vendor/PhpSpreadsheet/Calculation/Statistical/Minimum.php#L10-L20`.

```php
<?php

namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Statistical;

use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Functions;
use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue;

class Minimum extends MaxMinBase
{
	/**
				 * MIN.
				 *
				 * MIN returns the value of the element of the values passed that has the smallest value,
				 *        with negative numbers considered smaller than positive numbers.
				 *
				 * Excel Function:
				 *        MIN(value1[,value2[, ...]])
				 *
				 * @param mixed ...$args Data values
				 * @return float|int|string
				 */
				public static function min(...$args)
	{
		$returnValue = null;

		// Loop through arguments
		$aArgs = Functions::flattenArray($args);
		foreach ($aArgs as $arg) {
			if (ErrorValue::isError($arg, true)) {
				$returnValue = $arg;

				break;
			}
			// Is it a numeric value?
			if ((is_numeric($arg)) && (!is_string($arg))) {
				if (($returnValue === null) || ($arg < $returnValue)) {
					$returnValue = $arg;
				}
			}
		}

		if ($returnValue === null) {
			return 0;
		}
		/** @var float|int|string $returnValue */

		return $returnValue;
	}

	/**
				 * MINA.
				 *
				 * Returns the smallest value in a list of arguments, including numbers, text, and logical values
				 *
				 * Excel Function:
				 *        MINA(value1[,value2[, ...]])
				 *
				 * @param mixed ...$args Data values
				 * @return float|int|string
				 */
				public static function minA(...$args)
	{
		$returnValue = null;

		// Loop through arguments
		$aArgs = Functions::flattenArray($args);
		foreach ($aArgs as $arg) {
			if (ErrorValue::isError($arg, true)) {
				$returnValue = $arg;

				break;
			}
			// Is it a numeric value?
			if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
				$arg = self::datatypeAdjustmentAllowStrings($arg);
				if (($returnValue === null) || ($arg < $returnValue)) {
					$returnValue = $arg;
				}
			}
		}

		if ($returnValue === null) {
			return 0;
		}
		/** @var float|int|string $returnValue */

		return $returnValue;
	}
}

```
