Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-09-2008, 04:14 PM
cyraxote@gmail.com
 
Posts: n/a
updating DATEDIFF arguments in formula

Hi.

I have a column of dates, and at the bottom, I want to calculate the
number of days between the first and last dates. I' using the formula

=(DATEDIF(B6,B15,"d"))

The problem is that as I add dates, I have to edit the formula to
change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
there any way to make this work like other formulas do when you add
rows? Alternatively, is there another way to accomplish this
calculation that will update automatically?

Thanks.

Rodney
Reply With Quote
  #2 (permalink)  
Old 05-09-2008, 04:32 PM
Peo Sjoblom
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

If you are only going to calculate days you don't need a function at all,

=B15-B6

formatted as general will suffice

If you insert a row above this formula it will change to

=B16-B7



--


Regards,


Peo Sjoblom


<cyraxote@gmail.com> wrote in message
news:71da349f-65f5-4631-a534-1b702d58a7c2@59g2000hsb.googlegroups.com...
> Hi.
>
> I have a column of dates, and at the bottom, I want to calculate the
> number of days between the first and last dates. I' using the formula
>
> =(DATEDIF(B6,B15,"d"))
>
> The problem is that as I add dates, I have to edit the formula to
> change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
> there any way to make this work like other formulas do when you add
> rows? Alternatively, is there another way to accomplish this
> calculation that will update automatically?
>
> Thanks.
>
> Rodney



Reply With Quote
  #3 (permalink)  
Old 05-09-2008, 08:07 PM
GB
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

Datedif is an undocumented function in xl2003 - it does not even appear in
the fx list.

However, when I tried it, it worked, and the formula copied down
faultlessly. I cannot replicate the OP's problem.

Datedif might be useful in some circumstances, such as calculating complete
months. I agree that for days it's pretty pointless.



"Peo Sjoblom" <terre08@mvps.org> wrote in message
news:OMWbsnesIHA.5580@TK2MSFTNGP04.phx.gbl...
> If you are only going to calculate days you don't need a function at all,
>
> =B15-B6
>
> formatted as general will suffice
>
> If you insert a row above this formula it will change to
>
> =B16-B7
>
>
>
> --
>
>
> Regards,
>
>
> Peo Sjoblom
>
>
> <cyraxote@gmail.com> wrote in message
> news:71da349f-65f5-4631-a534-1b702d58a7c2@59g2000hsb.googlegroups.com...
>> Hi.
>>
>> I have a column of dates, and at the bottom, I want to calculate the
>> number of days between the first and last dates. I' using the formula
>>
>> =(DATEDIF(B6,B15,"d"))
>>
>> The problem is that as I add dates, I have to edit the formula to
>> change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
>> there any way to make this work like other formulas do when you add
>> rows? Alternatively, is there another way to accomplish this
>> calculation that will update automatically?
>>
>> Thanks.
>>
>> Rodney

>
>



Reply With Quote
  #4 (permalink)  
Old 05-09-2008, 09:22 PM
Peo Sjoblom
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

It's probably undocumented because it gives some strange results at times.
It was documented in 2000.


--


Regards,


Peo Sjoblom


"GB" <NOTsomeone@microsoft.com> wrote in message
news:4824a0f9$0$26089$db0fefd9@news.zen.co.uk...
> Datedif is an undocumented function in xl2003 - it does not even appear in
> the fx list.
>
> However, when I tried it, it worked, and the formula copied down
> faultlessly. I cannot replicate the OP's problem.
>
> Datedif might be useful in some circumstances, such as calculating
> complete months. I agree that for days it's pretty pointless.
>
>
>
> "Peo Sjoblom" <terre08@mvps.org> wrote in message
> news:OMWbsnesIHA.5580@TK2MSFTNGP04.phx.gbl...
>> If you are only going to calculate days you don't need a function at all,
>>
>> =B15-B6
>>
>> formatted as general will suffice
>>
>> If you insert a row above this formula it will change to
>>
>> =B16-B7
>>
>>
>>
>> --
>>
>>
>> Regards,
>>
>>
>> Peo Sjoblom
>>
>>
>> <cyraxote@gmail.com> wrote in message
>> news:71da349f-65f5-4631-a534-1b702d58a7c2@59g2000hsb.googlegroups.com...
>>> Hi.
>>>
>>> I have a column of dates, and at the bottom, I want to calculate the
>>> number of days between the first and last dates. I' using the formula
>>>
>>> =(DATEDIF(B6,B15,"d"))
>>>
>>> The problem is that as I add dates, I have to edit the formula to
>>> change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
>>> there any way to make this work like other formulas do when you add
>>> rows? Alternatively, is there another way to accomplish this
>>> calculation that will update automatically?
>>>
>>> Thanks.
>>>
>>> Rodney

>>
>>

>
>



Reply With Quote
  #5 (permalink)  
Old 05-09-2008, 10:31 PM
Mais qui est Paul
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

Bonsour® cyraxote@gmail.com avec ferveur ;o))) vous nous disiez :

> I have a column of dates, and at the bottom, I want to calculate the
> number of days between the first and last dates. I' using the formula
>
> =(DATEDIF(B6,B15,"d"))
>
> The problem is that as I add dates, I have to edit the formula to
> change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
> there any way to make this work like other formulas do when you add
> rows? Alternatively, is there another way to accomplish this
> calculation that will update automatically?


B6 is named : FirstDate
Define name LastDate
refers to : =OFFSET(FirstDate,COUNT(FirstDate:B1000)-1,0)

then :
=LastDate-FirstDate
formatted as general

or for the fun ;o)))

=INT((lastdate-firstdate)/365.25)&" year(s)
"&INT(MOD((lastdate-firstdate)/(365.25/12),12))&" month(s)
"&INT(MOD((lastdate-firstdate),365.25/12))&" day(s)"






--
--
@+
;o)))


Reply With Quote
  #6 (permalink)  
Old 05-15-2008, 04:21 PM
cyraxote@gmail.com
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

My problem is not that it won't copy down, but that ALL the terms copy
down.

For example,

=(DATEDIF(B6,B15,"d"))

becomes

=(DATEDIF(B7,B16,"d"))

but I want

=(DATEDIF(B6,B16,"d"))

I think one of the other posters talked about naming the cell and
using the defined name in the formula. Will try that.

Thanks.


On May 9, 3:07 pm, "GB" <NOTsome...@microsoft.com> wrote:
> Datedif is an undocumented function in xl2003 - it does not even appear in
> the fx list.
>
> However, when I tried it, it worked, and the formula copied down
> faultlessly. I cannot replicate the OP's problem.
>
> Datedif might be useful in some circumstances, such as calculating complete
> months. I agree that for days it's pretty pointless.
>
> "Peo Sjoblom" <terr...@mvps.org> wrote in message
>
> news:OMWbsnesIHA.5580@TK2MSFTNGP04.phx.gbl...
>
> > If you are only going to calculate days you don't need a function at all,

>
> > =B15-B6

>
> > formatted as general will suffice

>
> > If you insert a row above this formula it will change to

>
> > =B16-B7

>
> > --

>
> > Regards,

>
> > Peo Sjoblom

>
> > <cyrax...@gmail.com> wrote in message
> >news:71da349f-65f5-4631-a534-1b702d58a7c2@59g2000hsb.googlegroups.com...
> >> Hi.

>
> >> I have a column of dates, and at the bottom, I want to calculate the
> >> number of days between the first and last dates. I' using the formula

>
> >> =(DATEDIF(B6,B15,"d"))

>
> >> The problem is that as I add dates, I have to edit the formula to
> >> change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
> >> there any way to make this work like other formulas do when you add
> >> rows? Alternatively, is there another way to accomplish this
> >> calculation that will update automatically?

>
> >> Thanks.

>
> >> Rodney


Reply With Quote
  #7 (permalink)  
Old 05-15-2008, 04:27 PM
Craig Schiller
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

Try

=(DATEDIF($B$6,B15,"d"))


Craig


cyraxote@gmail.com wrote:

>My problem is not that it won't copy down, but that ALL the terms copy
>down.
>
>For example,
>
> =(DATEDIF(B6,B15,"d"))
>
>becomes
>
> =(DATEDIF(B7,B16,"d"))
>
>but I want
>
> =(DATEDIF(B6,B16,"d"))
>
>I think one of the other posters talked about naming the cell and
>using the defined name in the formula. Will try that.
>
>Thanks.
>
>
>On May 9, 3:07 pm, "GB" <NOTsome...@microsoft.com> wrote:
>
>
>>Datedif is an undocumented function in xl2003 - it does not even appear in
>>the fx list.
>>
>>However, when I tried it, it worked, and the formula copied down
>>faultlessly. I cannot replicate the OP's problem.
>>
>>Datedif might be useful in some circumstances, such as calculating complete
>>months. I agree that for days it's pretty pointless.
>>
>>"Peo Sjoblom" <terr...@mvps.org> wrote in message
>>
>>news:OMWbsnesIHA.5580@TK2MSFTNGP04.phx.gbl...
>>
>>
>>
>>>If you are only going to calculate days you don't need a function at all,
>>>
>>>
>>>=B15-B6
>>>
>>>
>>>formatted as general will suffice
>>>
>>>
>>>If you insert a row above this formula it will change to
>>>
>>>
>>>=B16-B7
>>>
>>>
>>>--
>>>
>>>
>>>Regards,
>>>
>>>
>>>Peo Sjoblom
>>>
>>>
>>><cyrax...@gmail.com> wrote in message
>>>news:71da349f-65f5-4631-a534-1b702d58a7c2@59g2000hsb.googlegroups.com...
>>>
>>>
>>>>Hi.
>>>>
>>>>
>>>>I have a column of dates, and at the bottom, I want to calculate the
>>>>number of days between the first and last dates. I' using the formula
>>>>
>>>>
>>>> =(DATEDIF(B6,B15,"d"))
>>>>
>>>>
>>>>The problem is that as I add dates, I have to edit the formula to
>>>>change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
>>>>there any way to make this work like other formulas do when you add
>>>>rows? Alternatively, is there another way to accomplish this
>>>>calculation that will update automatically?
>>>>
>>>>
>>>>Thanks.
>>>>
>>>>
>>>>Rodney
>>>>
>>>>

>
>
>


Reply With Quote
  #8 (permalink)  
Old 05-15-2008, 04:30 PM
cyraxote@gmail.com
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

OK, using defined labels for cell names didn't change anything.

I'm going to try to describe the problem again, because I think
there's a basic misunderstanding of my problem.

Let's say I have a column of 10 dates. The first date is in B1, and
the last is in B10.

In B12 is the following formula:

=(DATEDIF(B1,B10,"d"))

All works well.

A week later, I have a new date. I put the cursor in B11 and choose
Insert | Row. When I look at the formula, it still says

=(DATEDIF(B6,B15,"d"))

It did not change to =(DATEDIF(B2,B11,"d")), which would at least be
progress. It also did not change to =(DATEDIF(B1,B11,"d")), which is
what I want.

I need to anchor it to B1 somehow but keep the second reference
flexible. So far, I have to edit the formula every time I add data.

Does that make more sense now?

Thanks.








On May 9, 5:31 pm, "Mais qui est Paul" <Excel-add...@mpfe.fr> wrote:
> Bonsour® cyrax...@gmail.com avec ferveur ;o))) vous nous disiez :
>
> > I have a column of dates, and at the bottom, I want to calculate the
> > number of days between the first and last dates. I' using the formula

>
> > =(DATEDIF(B6,B15,"d"))

>
> > The problem is that as I add dates, I have to edit the formula to
> > change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
> > there any way to make this work like other formulas do when you add
> > rows? Alternatively, is there another way to accomplish this
> > calculation that will update automatically?

>
> B6 is named : FirstDate
> Define name LastDate
> refers to : =OFFSET(FirstDate,COUNT(FirstDate:B1000)-1,0)
>
> then :
> =LastDate-FirstDate
> formatted as general
>
> or for the fun ;o)))
>
> =INT((lastdate-firstdate)/365.25)&" year(s)
> "&INT(MOD((lastdate-firstdate)/(365.25/12),12))&" month(s)
> "&INT(MOD((lastdate-firstdate),365.25/12))&" day(s)"
>
> --
> --
> @+
> ;o)))


Reply With Quote
  #9 (permalink)  
Old 05-15-2008, 04:38 PM
cyraxote@gmail.com
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

Thanks, Craig, but no dice.

On May 15, 11:27*am, Craig Schiller <cschill...@earthlink.net> wrote:
> Try
>
> *=(DATEDIF($B$6,B15,"d"))
>
> Craig
>
>
>
> cyrax...@gmail.com wrote:
> >My problem is not that it won't copy down, but that ALL the terms copy
> >down.

>
> >For example,

>
> > =(DATEDIF(B6,B15,"d"))

>
> >becomes

>
> > =(DATEDIF(B7,B16,"d"))

>
> >but I want

>
> > =(DATEDIF(B6,B16,"d"))

>
> >I think one of the other posters talked about naming the cell and
> >using the defined name in the formula. Will try that.

>
> >Thanks.

>
> >On May 9, 3:07 pm, "GB" <NOTsome...@microsoft.com> wrote:

>
> >>Datedif is an undocumented function in xl2003 - it does not even appear in
> >>the fx list.

>
> >>However, when I tried it, it worked, and the formula copied down
> >>faultlessly. I cannot replicate the OP's problem.

>
> >>Datedif might be useful in some circumstances, such as calculating complete
> >>months. I agree that for days it's pretty pointless.

>
> >>"Peo Sjoblom" <terr...@mvps.org> wrote in message

>
> >>news:OMWbsnesIHA.5580@TK2MSFTNGP04.phx.gbl...

>
> >>>If you are only going to calculate days you don't need a function at all,

>
> >>>=B15-B6

>
> >>>formatted as general will suffice

>
> >>>If you insert a row above this formula it will change to

>
> >>>=B16-B7

>
> >>>--

>
> >>>Regards,

>
> >>>Peo Sjoblom

>
> >>><cyrax...@gmail.com> wrote in message
> >>>news:71da349f-65f5-4631-a534-1b702d58a7c2@59g2000hsb.googlegroups.com....

>
> >>>>Hi.

>
> >>>>I have a column of dates, and at the bottom, I want to calculate the
> >>>>number of days between the first and last dates. I' using the formula

>
> >>>> *=(DATEDIF(B6,B15,"d"))

>
> >>>>The problem is that as I add dates, I have to edit the formula to
> >>>>change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
> >>>>there any way to make this work like other formulas do when you add
> >>>>rows? Alternatively, is there another way to accomplish this
> >>>>calculation that will update automatically?

>
> >>>>Thanks.

>
> >>>>Rodney- Hide quoted text -

>
> - Show quoted text -


Reply With Quote
  #10 (permalink)  
Old 05-15-2008, 05:15 PM
cyraxote@gmail.com
 
Posts: n/a
Re: updating DATEDIFF arguments in formula

OK, this appears to be working at the moment, or at least will require
less maintenance.

Thanks!

On May 9, 5:31*pm, "Mais qui est Paul" <Excel-add...@mpfe.fr> wrote:
> Bonsour® cyrax...@gmail.com *avec ferveur *;o))) vous nous disiez :
>
> > I have a column of dates, and at the bottom, I want to calculate the
> > number of days between the first and last dates. I' using the formula

>
> > * =(DATEDIF(B6,B15,"d"))

>
> > The problem is that as I add dates, I have to edit the formula to
> > change B15 to the reference of the new row (e.g., B16, B17, etc.). Is
> > there any way to make this work like other formulas do when you add
> > rows? Alternatively, is there another way to accomplish this
> > calculation that will update automatically?

>
> B6 is named : FirstDate
> Define name LastDate
> refers to : =OFFSET(FirstDate,COUNT(FirstDate:B1000)-1,0)
>
> then :
> =LastDate-FirstDate
> formatted as general
>
> or for the fun ;o)))
>
> =INT((lastdate-firstdate)/365.25)&" year(s)
> "&INT(MOD((lastdate-firstdate)/(365.25/12),12))&" month(s)
> "&INT(MOD((lastdate-firstdate),365.25/12))&" day(s)"
>
> --
> --
> @+
> ;o)))


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:00 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Remortgages | Per Insurance | Classical Christian Education | Web Advertising | Auto Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114