subtracting dates

D

dmck

I am using Excel 2000

In the language of Excel, dates are actually numeric values based on
the number of days since January 1, 1900. i.e., the date 12/30/2003 is
actually the value 37985, or 37,985 days since January 1, 1900....or at
least that's how I understand it. Because of this nifty bit of info,
you can add and subtract dates. *My question, is there a formula that
says ONLY perform the subraction IF dates are present in both cells.*
I explain below.

Try the following, when you have time. Open a new worksheet.

- in A1 type the following formula - =A3-A2
- In A2 type 12/30/03
- In A3 type 1/7/03

A1 should now read 8, or 8 days. If it reads a date, just reformat
the cell. Splendid, yes? Now remove the value from A3. You'll
notice that A1 now says -37985. This is not date specific. If you
subtract 8 from 0 you will get -8. In this case you're saying 0
minus 37985 and getting the negative value. What I need is to say
ONLY perform the subtraction IF a value is typed into A3. IS THIS
POSSIBLE??
 
J

J.E. McGimpsey

If you want to return the result only if *both* A1 and A2 have
entries:

=IF(COUNT(A2:A3)=2,A3-A2,"")
 
M

mir

Re: substracting dates:

thanks!

replicated example:

1) in cel A2 enter: <12/30/2003> - FORMAT | CELL | DATE *2/14/2001

2) in cell a3 enter: <1/7/2004> - also same cell format as in 1)

3) in A1 enter: <=A3-A2> - FORMAT | CELL | GENERAL. The cell result i
"8" (days differnece
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top