code: public static function HARMEAN(...$args)
      {
          // Return value
          $returnValue = Functions::NA();
  
          // Loop through arguments
          $aArgs = Functions::flattenArray($args);
          if (self::MIN($aArgs) < 0) {
              return Functions::NAN();
          }
          $aCount = 0;
          foreach ($aArgs as $arg) {
              // Is it a numeric value?
              if ((is_numeric($arg)) && (!is_string($arg))) {
                  if ($arg <= 0) {
                      return Functions::NAN();
                  }
                  if ($returnValue === null) {
                      $returnValue = (1 / $arg);
                  } else {
                      $returnValue += (1 / $arg);
                  }
                  ++$aCount;
              }
          }
  
          // Return
          if ($aCount > 0) {
              return 1 / ($returnValue / $aCount);
          }
  
          return $returnValue;
      }
docs: HARMEAN.
  
  Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the
  arithmetic mean of reciprocals.
  
  Excel Function:
  HARMEAN(value1[,value2[, ...]])
  
  @category Statistical Functions
  
  @param mixed ...$args Data values
  
  @return float