days since beginning of year

classic Classic list List threaded Threaded
8 messages Options
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

days since beginning of year

How do I get the number of days since the beginning of year?


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Brad Rogers Brad Rogers
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year

On Sun, 4 Apr 2021 18:54:28 -0400
James <[hidden email]> wrote:

Hello James,

>How do I get the number of days since the beginning of year?

Use the DAYS function.  See;
<https://help.libreoffice.org/latest/en-GB/text/scalc/01/func_days.html?DbPAR=CALC#bm_id3151328>

Note particularly the advice about NOT using locale specific date
formats due to the possibility of errors.

--
 Regards  _
         / )           "The blindingly obvious is
        / _)rad        never immediately apparent"
Tell the dinosaurs they just won't survive
The History Of The World (Part 1) - The Damned

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

cspiess@ieee.org cspiess@ieee.org
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year

In reply to this post by bjlockie
I assume you're asking about how to get the days since the beginning of the
year given an existing date and that you're using LibreOffice Calc.  With
this in mind, here is an example:

=DATEDIF("2020-12-31","2021-01-27","d")

The resulting value in the cell will be 27.

The first parameter is the starting date.  Middle parameter is the current
date in question (I used Jan 27th in my example).  The third parameter is
the interval Calc should use, which is days here, hence "d".  Note that if
you use 2020-01-01 as the start date, then the 27th day of January would
actually only be the 26th day since Jan 1st, so you need to use a starting
date of the last day of the prior year.

Hope this helps!


On Sun, Apr 4, 2021 at 3:59 PM James <[hidden email]> wrote:

> How do I get the number of days since the beginning of year?
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year

How do I get the start date to be dynamically the current year?

Apr. 4, 2021 19:30:53 [hidden email]:

> I assume you're asking about how to get the days since the beginning of the year given an existing date and that you're using LibreOffice Calc.  With this in mind, here is an example:
>
> =DATEDIF("2020-12-31","2021-01-27","d")
>
> The resulting value in the cell will be 27.
>
> The first parameter is the starting date.  Middle parameter is the current date in question (I used Jan 27th in my example).  The third parameter is the interval Calc should use, which is days here, hence "d".  Note that if you use 2020-01-01 as the start date, then the 27th day of January would actually only be the 26th day since Jan 1st, so you need to use a starting date of the last day of the prior year.
>
> Hope this helps!
>
>
> On Sun, Apr 4, 2021 at 3:59 PM James <[hidden email]> wrote:
>> How do I get the number of days since the beginning of year?
>>
>>
>> --
>> To unsubscribe e-mail to: [hidden email][users%[hidden email]]
>> Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
>> List archive: https://listarchives.libreoffice.org/global/users/
>> Privacy Policy: https://www.documentfoundation.org/privacy

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year

In reply to this post by cspiess@ieee.org
How about this?

=DAYS(CONCAT(YEAR(TODAY()),"-",MONTH(TODAY()),"-",DAY(TODAY())),CONCAT(YEAR(TODAY())-1,"-12-31"))

On 2021-04-04 7:30 p.m., [hidden email] wrote:

> I assume you're asking about how to get the days since the beginning
> of the year given an existing date and that you're using LibreOffice
> Calc.  With this in mind, here is an example:
>
> =DATEDIF("2020-12-31","2021-01-27","d")
>
> The resulting value in the cell will be 27.
>
> The first parameter is the starting date.  Middle parameter is the
> current date in question (I used Jan 27th in my example).  The third
> parameter is the interval Calc should use, which is days here, hence
> "d".  Note that if you use 2020-01-01 as the start date, then the 27th
> day of January would actually only be the 26th day since Jan 1st, so
> you need to use a starting date of the last day of the prior year.
>
> Hope this helps!
>
>
> On Sun, Apr 4, 2021 at 3:59 PM James <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     How do I get the number of days since the beginning of year?
>
>
>     --
>     To unsubscribe e-mail to: [hidden email]
>     <mailto:users%[hidden email]>
>     Problems?
>     https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>     <https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/>
>     Posting guidelines + more:
>     https://wiki.documentfoundation.org/Netiquette
>     <https://wiki.documentfoundation.org/Netiquette>
>     List archive: https://listarchives.libreoffice.org/global/users/
>     <https://listarchives.libreoffice.org/global/users/>
>     Privacy Policy: https://www.documentfoundation.org/privacy
>     <https://www.documentfoundation.org/privacy>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year


>At 18:54 04/04/2021 -0400, James Lockie wrote:
>How do I get the number of days since the beginning of year?

At 00:29 05/04/2021 +0000, James Lockie wrote:
>How do I get the start date to be dynamically the current year?

At 21:04 04/04/2021 -0400, James Lockie wrote:
>How about this?
>=DAYS(CONCAT(YEAR(TODAY()),"-",MONTH(TODAY()),"-",DAY(TODAY())),CONCAT(YEAR(TODAY())-1,"-12-31"))

I think you have dismantled today's date and then reassembled it.

Perhaps, more easily, this?
=DAYS(TODAY(),DATE(YEAR(TODAY()),1,1))+1
Or this?
=DAYS(TODAY(),YEAR(TODAY())&"-1-1")+1

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Johnny Rosenberg Johnny Rosenberg
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year

In reply to this post by bjlockie
Den mån 5 apr. 2021 kl 03:46 skrev James <[hidden email]>:

> How do I get the start date to be dynamically the current year?
>

Current year:
=YEAR(NOW())
First day of current year:
=DATE(YEAR(NOW());1;1)
Last day of last year:
=DATE(YEAR(NOW());1;1)-1
or
=DATE(YEAR(NOW())-1;12;31)
Days this year so far:
=NOW()-DATE(YEAR(NOW());1;1)+1
or
=DATEDIF(DATE(YEAR(NOW());1;1)-1;NOW();"d")
The last one returns an integer. If you want to use the first one to return
an integer, just modify it like this:
=INT(NOW()-DATE(YEAR(NOW());1;1)+1)


Kind regards

Johnny Rosenberg


>
> Apr. 4, 2021 19:30:53 [hidden email]:
>
> > I assume you're asking about how to get the days since the beginning of
> the year given an existing date and that you're using LibreOffice Calc.
> With this in mind, here is an example:
> >
> > =DATEDIF("2020-12-31","2021-01-27","d")
> >
> > The resulting value in the cell will be 27.
> >
> > The first parameter is the starting date.  Middle parameter is the
> current date in question (I used Jan 27th in my example).  The third
> parameter is the interval Calc should use, which is days here, hence "d".
> Note that if you use 2020-01-01 as the start date, then the 27th day of
> January would actually only be the 26th day since Jan 1st, so you need to
> use a starting date of the last day of the prior year.
> >
> > Hope this helps!
> >
> >
> > On Sun, Apr 4, 2021 at 3:59 PM James <[hidden email]> wrote:
> >> How do I get the number of days since the beginning of year?
> >>
> >>
> >> --
> >> To unsubscribe e-mail to: [hidden email][
> users%[hidden email]]
> >> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> >> Posting guidelines + more:
> https://wiki.documentfoundation.org/Netiquette
> >> List archive: https://listarchives.libreoffice.org/global/users/
> >> Privacy Policy: https://www.documentfoundation.org/privacy
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Gabriele Ponzo Gabriele Ponzo
Reply | Threaded
Open this post in threaded view
|

Re: days since beginning of year

In reply to this post by bjlockie
You already have the answer, as you have used the YEAR function in your
previous message.
So YEAR(cell) will give you just the year from the date expressed in "cell".
---
Gabriele Ponzo


Il giorno lun 5 apr 2021 alle ore 03:46 James <[hidden email]> ha
scritto:

> How do I get the start date to be dynamically the current year?
>
> Apr. 4, 2021 19:30:53 [hidden email]:
>
> > I assume you're asking about how to get the days since the beginning of
> the year given an existing date and that you're using LibreOffice Calc.
> With this in mind, here is an example:
> >
> > =DATEDIF("2020-12-31","2021-01-27","d")
> >
> > The resulting value in the cell will be 27.
> >
> > The first parameter is the starting date.  Middle parameter is the
> current date in question (I used Jan 27th in my example).  The third
> parameter is the interval Calc should use, which is days here, hence "d".
> Note that if you use 2020-01-01 as the start date, then the 27th day of
> January would actually only be the 26th day since Jan 1st, so you need to
> use a starting date of the last day of the prior year.
> >
> > Hope this helps!
> >
> >
> > On Sun, Apr 4, 2021 at 3:59 PM James <[hidden email]> wrote:
> >> How do I get the number of days since the beginning of year?
> >>
> >>
> >> --
> >> To unsubscribe e-mail to: [hidden email][
> users%[hidden email]]
> >> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> >> Posting guidelines + more:
> https://wiki.documentfoundation.org/Netiquette
> >> List archive: https://listarchives.libreoffice.org/global/users/
> >> Privacy Policy: https://www.documentfoundation.org/privacy
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy