Using dates as function arguments in Excel
Hi Johnston,
If the following is entered into a cell which has the general format it will
retain the format.
=IF(A1A2,A1-A2,-(A2-A1))
assuming dates in a1 and a2
Hope that is helpful
Anthony
"johnston" wrote:
I am looking for a reliable way to use the numbers obtained when doing
arithmetic functions on dates as input for a subsequent calculation. For
example, when subtracting dates, I get an error message. This can be
corrected by resetting the format of the cell to "general," but this would
be too onerous to do every time. I also need a way to do this when
subtracting an earlier date from a later date, which would yield a negative
number. Thanks.
|