subtraction with dates

J

Juco

How do I subtract a date from another date togive the answer in days, I have
tried...

=DATE(I7,H7,G7)-(E7,D7,C7) this would represent (22-07-2005)-(1-07-2005)
and should equal 21 days.(UK time format)

thanks
 
B

Bob Phillips

=DATE(G7,H7,I7)-DATE(C7,D7,E7)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Guest

Juco

I have a spreadsheet that does this and as long as the date is entered in
the right format, ( i.e. 12/06/05) and the column or cell is set to a date
format (which will change the date to 12-Jun-05), then just subtracting each
cell from each other should do the trick.

A1 = 21-Feb-05
B1 = 22-Feb-05
C1 = B1-A1 = 1

Hope this helps
Linds
 
J

Juco

The formula =DATE(G7,H7,I7)-DATE(C7,D7,E7)
is returning 7670 as seen below, whats wrong?

date mnth year date mnth year
1 7 2005 TO 22 7 2005
No of weeks 7670
 
B

Bob Phillips

If you want weeks, then

=(DATE(I7,H7,G7)-DATE(E7,D7,C7))/7

if not

=DATE(I7,H7,G7)-DATE(E7,D7,C7)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
M

Myrna Larson

What's wrong? You layout is D, M, Y; the formula assumes Y, M, D.

Look at Help for the DATE function so you understand what the arguments are.
 
J

Juco

Ok thanks I have now got it sorted, my lack of knowledge caused the problem.

your help appreciated.
thanks
 

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