|
|
@@ -418,6 +418,7 @@ class CellExpressionSet {
|
|
418
|
418
|
case 'FLOOR': return $this->funcFloor($args, $address);
|
|
419
|
419
|
case 'IF': return $this->funcIf($args, $address);
|
|
420
|
420
|
case 'IFS': return $this->funcIfs($args, $address);
|
|
|
421
|
+ case 'ISBLANK': return $this->funcIsBlank($args, $address);
|
|
421
|
422
|
case 'LN': return $this->funcLn($args, $address);
|
|
422
|
423
|
case 'LOG': return $this->funcLog($args, $address);
|
|
423
|
424
|
case 'LOWER': return $this->funcLower($args, $address);
|
|
|
@@ -672,6 +673,25 @@ class CellExpressionSet {
|
|
672
|
673
|
}
|
|
673
|
674
|
|
|
674
|
675
|
/**
|
|
|
676
|
+ * `IFBLANK(value)` - Returns `TRUE` if the given value is blank, otherwise
|
|
|
677
|
+ * `FALSE`.
|
|
|
678
|
+ *
|
|
|
679
|
+ * @param array $args raw arguments
|
|
|
680
|
+ * @param CellAddress $address expression location
|
|
|
681
|
+ * @return CellValue result
|
|
|
682
|
+ */
|
|
|
683
|
+ private function funcIsBlank(array $args, CellAddress $address): CellValue {
|
|
|
684
|
+ if (sizeof($args) !== 1) {
|
|
|
685
|
+ throw new CellEvaluationException("IFBLANK expects 1 argument");
|
|
|
686
|
+ }
|
|
|
687
|
+ $arg = $this->evaluate($args[0], $address);
|
|
|
688
|
+ if (!($arg instanceof CellValue)) {
|
|
|
689
|
+ throw new CellEvaluationException("IFBLANK expcts 1 argument");
|
|
|
690
|
+ }
|
|
|
691
|
+ return CellValue::fromValue($arg->type === CellValue::TYPE_BLANK);
|
|
|
692
|
+ }
|
|
|
693
|
+
|
|
|
694
|
+ /**
|
|
675
|
695
|
* `LN(value)` - Natural log.
|
|
676
|
696
|
*
|
|
677
|
697
|
* @param array $args raw arguments
|