• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Formula to get calendar day 15th

Sasi Kumar

New Member
Hi,

Can anyone help me with a formula to get calendar day 15th of the month basis the below sample conditions.

Ex1: If given date is 01/22/2016 then result should be 01/15/2016.

Ex2: If given date is 01/09/2016 then result should be 12/15/2016.

Ex3: If given date is 01/15/2016 then result should be 01/15/2016.
 
Hi,

I need one more help on calendar day 15th formula shared above, which is working fine but need help on the below two report run date and timings:

First Report Run (Date & Time[24 hrs format]):

If the given date with time is 02/15/2016 15:30:00 and the actual report run date and time is every months calendar day 15th with 23:00:00, hence the result for the above given date and time should be 01/15/2016 23:00:00

Second Report Run (Date & Time[24 hrs format]):

If the report run date and time is every months calendar day 15th with 6:55:00 then the result should be 02/15/2016 6:55:00

Please help me with the formula accordingly.
 
Hi @Sasi Kumar

I'm not quite understanding your question?
Am I right in thinking that if the time is after (say) midday then it should be DATE + 23:00:00, but if it's before it should be the DATE + actual time?
 
Hi,

The output date and time will not depend on midday or 23:00:00 hrs. The report run [Date & Time] are constant here. This wouldn't change. Whatever date and time the end user provides in the input field the out date and time changes taking into consideration of report run date and time and date and time provided by end user.

The actual report run [Date and Time] is every month calendar day 15th at 23:00:00 hrs.

Ex1: If the given date and time is 02/15/2016 15:30:00, then the result should be 01/15/2016 23:00:00

Ex2: If the given date and time is 02/15/2016 23:15:00, then the result should be 02/15/2016 23:00:00
 
Dear Sasi

Which of the above formula are you using?

=IF(A1-DATE(YEAR(A1),MONTH(A1),0)>14,DATE(YEAR(A1),MONTH(A1),0)+15,DATE(YEAR(A1),MONTH(A1)-1,15))

or

=DATE(YEAR(A1),MONTH(A1)-(DAY(A1)<15),15)

Let me know so I know which to adapt for your new requirements.
 
Dear Sasi

For the First report run:

=DATE(YEAR(A1),MONTH(A1)-(DAY(A1)+MOD(A1,1)<15+23/24),15)+23/24

For the second report run:

=DATE(YEAR(A1),MONTH(A1)-(DAY(A1)+MOD(A1,1)<15+6.92/24),15)+6.92/24

Jake
 
Back
Top