Functions (all)
Diff
- Function Name:
- Diff
- Description:
-
Takes 2 numbers and returns the difference between them expressed as a positive value. For example, if you wanted to see the age difference between a person and their first spouse (in years), you could use this expression:
=Diff(Year(%INDI.BIRT.DATE%),Year(%INDI.~SPOU>BIRT.DATE%))
If, on the other hand, you wanted to subtract the latter from the former so that you get a negative value if the spouse is born later than the first person, you could use this:
=Calc(Year(%INDI.BIRT.DATE%) -Year(%IND.~SPOU.BIRT.DATE%))
- Minimum FH Version:
- 4.0
- No. of Parameters:
- 2
- Return Type:
- Number
- Parameter 1:
- First number
- Parameter 2:
- Second number
- Examples:
-
=Diff(Year(%INDI.BIRT.DATE%),Year(%INDI.~SPOU>BIRT.DATE%))