code: public static function MDETERM($matrixValues)
      {
          $matrixData = [];
          if (!is_array($matrixValues)) {
              $matrixValues = [[$matrixValues]];
          }
  
          $row = $maxColumn = 0;
          foreach ($matrixValues as $matrixRow) {
              if (!is_array($matrixRow)) {
                  $matrixRow = [$matrixRow];
              }
              $column = 0;
              foreach ($matrixRow as $matrixCell) {
                  if ((is_string($matrixCell)) || ($matrixCell === null)) {
                      return Functions::VALUE();
                  }
                  $matrixData[$column][$row] = $matrixCell;
                  ++$column;
              }
              if ($column > $maxColumn) {
                  $maxColumn = $column;
              }
              ++$row;
          }
          if ($row != $maxColumn) {
              return Functions::VALUE();
          }
  
          try {
              $matrix = new Matrix($matrixData);
  
              return $matrix->det();
          } catch (PhpSpreadsheetException $ex) {
              return Functions::VALUE();
          }
      }
docs: MDETERM.
  
  Returns the matrix determinant of an array.
  
  Excel Function:
  MDETERM(array)
  
  @category Mathematical and Trigonometric Functions
  
  @param array $matrixValues A matrix of values
  
  @return float