code: public static function DEVSQ(...$args)
      {
          $aArgs = Functions::flattenArrayIndexed($args);
  
          // Return value
          $returnValue = null;
  
          $aMean = self::AVERAGE($aArgs);
          if ($aMean != Functions::DIV0()) {
              $aCount = -1;
              foreach ($aArgs as $k => $arg) {
                  // Is it a numeric value?
                  if ((is_bool($arg)) &&
                      ((!Functions::isCellValue($k)) ||
                      (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
                      $arg = (int) $arg;
                  }
                  if ((is_numeric($arg)) && (!is_string($arg))) {
                      if ($returnValue === null) {
                          $returnValue = pow(($arg - $aMean), 2);
                      } else {
                          $returnValue += pow(($arg - $aMean), 2);
                      }
                      ++$aCount;
                  }
              }
  
              // Return
              if ($returnValue === null) {
                  return Functions::NAN();
              }
  
              return $returnValue;
          }
  
          return self::NA();
      }
docs: DEVSQ.
  
  Returns the sum of squares of deviations of data points from their sample mean.
  
  Excel Function:
  DEVSQ(value1[,value2[, ...]])
  
  @category Statistical Functions
  
  @param mixed ...$args Data values
  
  @return float