code: public static function IMDIV($complexDividend, $complexDivisor)
      {
          $complexDividend = Functions::flattenSingleValue($complexDividend);
          $complexDivisor = Functions::flattenSingleValue($complexDivisor);
  
          $parsedComplexDividend = self::parseComplex($complexDividend);
          $parsedComplexDivisor = self::parseComplex($complexDivisor);
  
          if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') &&
              ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])
          ) {
              return Functions::NAN();
          }
          if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) {
              $parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix'];
          }
  
          $d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']);
          $d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']);
          $d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']);
  
          $r = $d1 / $d3;
          $i = $d2 / $d3;
  
          if ($i > 0.0) {
              return self::cleanComplex($r . '+' . $i . $parsedComplexDivisor['suffix']);
          } elseif ($i < 0.0) {
              return self::cleanComplex($r . $i . $parsedComplexDivisor['suffix']);
          }
  
          return $r;
      }
docs: IMDIV.
  
  Returns the quotient of two complex numbers in x + yi or x + yj text format.
  
  Excel Function:
  IMDIV(complexDividend,complexDivisor)
  
  @param string $complexDividend the complex numerator or dividend
  @param string $complexDivisor the complex denominator or divisor
  
  @return string