Value1 - Value2 Value1 - Value2

Value1

Number Number

The number to subtract from (the minuend ).

Value2

Number Number

The number which should be substracted from the first number (the subtrahend ).

Returns

Number Number

The difference between the numbers.

Subtracts one number from another and returns the result. 8 - 38 - 3 returns 5.

This operator also works with arrays. { 8, 9 } - 6{ 8; 9 } - 6 returns the array { 2, 3 }{ 2; 3 } (equivalent to { 8 - 6, 9 - 6 }{ 8 - 6; 9 - 6 }) and { 8, 9 } - { 6, 10 }{ 8; 9 } - { 6; 10 } returns the array { 2, - 1 }{ 2; - 1 } (equivalent to { 8 - 6, 9 - 10 }{ 8 - 6; 9 - 10 }).

Subtracting many values

The SUM function is equivalent to this operator, provided that all parameters other than the first one are negated.

These formulas both return 5:

8 - 3
8 - 3

SUM (8, - 3)
SUM (8; - 3)

However, SUM can be invoked with arrays with an arbitrary number of elements. To subtract the elements of NumberArray from the value of Value1 and return the result, use this formula:

SUM (Value1, - NumberArray)
SUM (Value1; - NumberArray)

Examples

8 - 3
8 - 3

Returns 5.

{ 8, 9 } - 6
{ 8; 9 } - 6

Returns the array { 2, 3 }{ 2; 3 }, equivalent to { 8 - 6, 9 - 6 }{ 8 - 6; 9 - 6 }.

{ 8, 9 } - { 6, 10 }
{ 8; 9 } - { 6; 10 }

Returns the array { 2, - 1 }{ 2; - 1 }, equivalent to { 8 - 6, 9 - 10 }{ 8 - 6; 9 - 10 }.

Value1 - Value2 Value1 - Value2

Value1

Temporal Temporal

The date to subtract a number of days from.

Value2

Number Number

The number of days to subtract.

Returns

Temporal Temporal

The date arrived at by subtracting the given number of days from the given date.

Subtracts a number of days from a date and returns the resulting date. DATE (2024, 1, 8) - 7 DATE (2024; 1; 8) - 7 returns January 1, 2024.

The number of days need not be a whole number. Subtracting 0.5 moves the date back by twelve hours.

Examples

DATE (2024, 1, 8) - 7
DATE (2024; 1; 8) - 7

Returns January 1, 2024.

TODAY () - 1
TODAY () - 1

Returns yesterday's date.

Date - 7
Date - 7

Returns the date one week before Date .

Value1 - Value2 Value1 - Value2

Value1

Temporal Temporal

The date to subtract from (the minuend ).

Value2

Temporal Temporal

The date which should be subtracted from the first date (the subtrahend ).

Returns

Number Number

The number of days between the given dates.

Subtracts one date from another and returns the number of days between them. DATE (2024, 1, 8) - DATE (2024, 1, 1) DATE (2024; 1; 8) - DATE (2024; 1; 1) returns 7.

Unlike the other operators working with dates, this operator returns a number and not a date. The difference between two dates is a count of days, and not itself a point in time.

The returned number of days need not be a whole number, as the times of day of the given dates are taken into account. If the first date precedes the second one, a negative number is returned.

Examples

DATE (2024, 1, 8) - DATE (2024, 1, 1)
DATE (2024; 1; 8) - DATE (2024; 1; 1)

Returns 7.

TODAY () - StartDate
TODAY () - StartDate

Returns the number of days that have elapsed since StartDate .

EndDate - StartDate
EndDate - StartDate

Returns the number of days between StartDate and EndDate .

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell