A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculate number of days



 
 
Thread Tools Display Modes
  #1  
Old April 23rd, 2010, 06:35 PM posted to microsoft.public.excel.worksheet.functions
Linda P.
external usenet poster
 
Posts: 1
Default Calculate number of days

I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.
  #2  
Old April 23rd, 2010, 06:45 PM posted to microsoft.public.excel.worksheet.functions
Rick Rothstein[_2_]
external usenet poster
 
Posts: 2,013
Default Calculate number of days

That can't be done... the number of days in the month depends on the start
date for the calculation. For example, two months starting January 1st has a
different number of days in it than two months starting on March 1st.

--
Rick (MVP - Excel)



"Linda P." Linda wrote in message
...
I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.


  #3  
Old April 23rd, 2010, 07:20 PM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default Calculate number of days

=EDATE(1,A2+A1*12)+A3


"Linda P." wrote:

I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.

  #4  
Old April 23rd, 2010, 08:02 PM posted to microsoft.public.excel.worksheet.functions
Joe User[_2_]
external usenet poster
 
Posts: 757
Default Calculate number of days

"Teethless mama" wrote:
=EDATE(1,A2+A1*12)+A3


Shouldn't there be a -1 at the end? Consider when years (A2) and months
(A1) are zero, and days (A3) is 1. I think the result should be 1, not 2.

However, I think it behooves you to point out that that measures time from
1/1/1900. Why not some other date, notably a date before Feb 29 in a leap
year? Whose to say any other result is wrong? (Rhetorical question.)

I think it would be better to suggest that Linda pick a starting date, and
to note that the result may be different for different starting dates. Then,
using your clever paradigm (if A4 is the starting date):

=EDATE(A4,A2+12*A1)+A3-A4

We should add the caveat that it would be prudent for A4 (the starting date)
to be some day of the month less than 29.

So, =TODAY() is a dubious choice. A reasonable choice might be
=TODAY()-DAY(TODAY())+1, which is the first of the current month.

But of course, if Linda has little control over the starting date (e.g. a
hire date) that might be the 29th through 31st of the month, she needs to be
aware that EDATE might map that into the end of the month that is
A2+12*A1+MONTH(A4) months from A4, which might be short by as many as 3 days.

I suspect that would be the "right" answer for the application in that case.
But she might want to give that some thought to be sure.


----- original message -----

"Teethless mama" wrote:
=EDATE(1,A2+A1*12)+A3


"Linda P." wrote:

I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.

  #5  
Old April 23rd, 2010, 09:26 PM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,722
Default Calculate number of days

Shouldn't there be a -1 at the end? Consider when years (A2) and months
(A1) are zero, and days (A3) is 1. I think the result should be 1, not 2.


You are absolutely right, it should be -1 at the end.
Since the OP didn't provide the start date, so I use the Excel base date for
the start date.

=EDATE(Start_Date,A2+A1*12)+A3-Start_Date



"Joe User" wrote:

"Teethless mama" wrote:
=EDATE(1,A2+A1*12)+A3


Shouldn't there be a -1 at the end? Consider when years (A2) and months
(A1) are zero, and days (A3) is 1. I think the result should be 1, not 2.

However, I think it behooves you to point out that that measures time from
1/1/1900. Why not some other date, notably a date before Feb 29 in a leap
year? Whose to say any other result is wrong? (Rhetorical question.)

I think it would be better to suggest that Linda pick a starting date, and
to note that the result may be different for different starting dates. Then,
using your clever paradigm (if A4 is the starting date):

=EDATE(A4,A2+12*A1)+A3-A4

We should add the caveat that it would be prudent for A4 (the starting date)
to be some day of the month less than 29.

So, =TODAY() is a dubious choice. A reasonable choice might be
=TODAY()-DAY(TODAY())+1, which is the first of the current month.

But of course, if Linda has little control over the starting date (e.g. a
hire date) that might be the 29th through 31st of the month, she needs to be
aware that EDATE might map that into the end of the month that is
A2+12*A1+MONTH(A4) months from A4, which might be short by as many as 3 days.

I suspect that would be the "right" answer for the application in that case.
But she might want to give that some thought to be sure.


----- original message -----

"Teethless mama" wrote:
=EDATE(1,A2+A1*12)+A3


"Linda P." wrote:

I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.

  #6  
Old April 23rd, 2010, 10:46 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Calculate number of days

Rick,

Is one of the years a leap year? Another reason why this is impossible.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Rick Rothstein" wrote:

That can't be done... the number of days in the month depends on the start
date for the calculation. For example, two months starting January 1st has a
different number of days in it than two months starting on March 1st.

--
Rick (MVP - Excel)



"Linda P." Linda wrote in message
...
I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.


.

  #7  
Old April 24th, 2010, 12:09 PM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
Default Calculate number of days

As others have said, it depends on the start date.
If the start date is in A5, the number of days is
=DATE(YEAR(A5)+A1,MONTH(A5)+A2,DAY(A5)+A3)-A5 and format as General or
Number.
--
David Biddulph


"Linda P." Linda wrote in message
...
I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.



  #8  
Old April 27th, 2010, 04:29 PM posted to microsoft.public.excel.worksheet.functions
Linda P.[_2_]
external usenet poster
 
Posts: 1
Default Calculate number of days

Thank you Teethless Mama and David Biddulph! Either formula will work for me.

"Linda P." wrote:

I am using Excel 2000.
I need help with a formula. In A1 I have # of years, in A2 I have # of
months and in A3 I have # of days. In A4 I want to add A1 through A3 and
show the total as number of days. Thanks for your help.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.