Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Using dates as function arguments in Excel

Hi Anthony,

Thanks for the reply. That works, but I may have uncovered another problem.
Even when subtracting dates (earlier from a later to give a positive #),
excel is changing the cell format to a custom format rather than retaining
the general format.

Ken
"Anthony D" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting numbers stored as dates to text in Excel David from Furdale Excel Discussion (Misc queries) 1 July 17th 06 06:34 PM
FUNCTION GETPIVOTDATA MICROSOFT EXCEL 2003 VS EXCEL 2004 FOR MAC FRANCISCO PEREZ-LANDAETA Excel Worksheet Functions 0 July 6th 06 01:25 PM
How do I use the excel timeline function with dates in graphs sweet4511 Excel Worksheet Functions 1 August 2nd 05 05:54 PM
Stop Excel Rounding Dates leinad512 Excel Discussion (Misc queries) 1 April 20th 05 04:19 PM
I cant use englisch function names in a swedich version of excel PE Excel Discussion (Misc queries) 2 December 7th 04 01:00 AM


All times are GMT +1. The time now is 06:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"