def percent_changefrom_target(target_val: float, actual_val: float,
                              frac: bool = False) -> float:
    """ Return the percentage change between target and actual values.
        The denominator is the target value.
        Equation used is (target_val - actual_val)/target_val

            target_val: float, target value

            actual_val: float, current actual value

            frac: bool, Default is False. Set to True returns a fraction
                instead of percentages. This is useful for performing
                calculations on spreadsheets.

            return: float, percentage difference or fraction

            Usage
            -----
            >>> percent_changefrom_target(5, 7)
            -40.0
            >>> percent_changefrom_target(5, 7, frac=True)
            -0.4
        """
    perchg = (target_val - actual_val)/target_val
    if frac is False:
        perchg *= 100
    return perchg