anchor.diff:        final format = range.conditionalFormats.add('Custom');
   
         // Excel formula DATEDIF(dateA, dateB, "D") calculates the difference
  -      // between two dates in days. This formula calculates:
  -      // (spent / budget) * (flight duration/ current duration)
  -      // if current duration or flight duration is zero days, then the formula
  -      // simply calculates (spent / budget).
  -      final formula = '''
  -      IF(OR(DATEDIF($_startDateColumn, $_endDateColumn, "D") = 0, 
  -            DATEDIF($_startDateColumn, NOW(), "D") = 0),
  -         ($_spentColumn/$_budgetColumn),   
  -         ($_spentColumn/$_budgetColumn) * 
  -         (
  -           DATEDIF($_startDateColumn, $_endDateColumn, "D") /
  -           DATEDIF($_startDateColumn, NOW(), "D")
  -         )) < $_thresholdAddress
  +      // between two dates in days, where dateB must be after or equal to dateA.
  +      // i.e. DATEDIF("7/1/2020", "7/31/2020", "D") = 30
  +      //
  +      // This formula calculates:
  +      // (spent / budget) / (current duration / flight duration)
  +      //
  +      // Flight duration is calculated by (end date - start date + 1), and
  +      // current duration is calculated by (now - start date + 1), so it is
  +      // guaranteed that divide by zero will not happen.
  +      final formula = ''' 
  +       ($_spentColumn/$_budgetColumn) / 
  +       (
  +         (DATEDIF($_startDateColumn, NOW(), "D") + 1) /
  +         (DATEDIF($_startDateColumn, $_endDateColumn, "D") + 1)
  +       ) < $_thresholdAddress
         ''';
   
         // remove all tabs, newlines, and whitespace from the formula.
  
positive.code:   static const _leftAlignment = 'Left';
  
    static const _borderStyle = 'Continuous';
  
    static const _currencyFormat = '\$#,##0.00';
    static const _underpacingFormatFont = '#9C0006';
    static const _underpacingFormatFill = '#FFC7CE';
  
    /// Column addresses calculated based on [_tableHeader].
    static final _spentColumn =
        '\$${_getExcelColumnReference(_tableHeader.indexOf('Spent'))}'
        '${_tableRowStartAddress + 1}';
    static final _budgetColumn =
        '\$${_getExcelColumnReference(_tableHeader.indexOf('Budget'))}'
        '${_tableRowStartAddress + 1}';
    static final _startDateColumn =
        '\$${_getExcelColumnReference(_tableHeader.indexOf('Start Date'))}'
        '${_tableRowStartAddress + 1}';
    static final _endDateColumn =
        '\$${_getExcelColumnReference(_tableHeader.indexOf('End Date'))}'
        '${_tableRowStartAddress + 1}';
  
    /// Header for the master table.
    ///
  
negative.code:     }));
    }
  
    static String _getExcelColumnReference(int offset) => String.fromCharCode(
        _resultTableColumnStartAddress.codeUnitAt(0) + offset);
  
    /// Conditionally formats the Budget column based on Budget Unit.
    ///
  