ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If functions for dates (https://www.excelbanter.com/excel-worksheet-functions/47324-if-functions-dates.html)

if function for remaining days in month

If functions for dates
 
Hi I need to know if anyone can give me an IF Function that will calculate
the number of days remaining in a given month. For example, if the date is
July 17th, the calculation would be 31-17+1=15 days. My problem is setting
the citeria to recognize whether the month is a 31 day month/30 day month or
28/29 day month (I would prefer not having to enter in that information for
each date). Please help! Thank you!



Rowan

Assuming you have entered your date in A1 then this formula should do it;
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))-DAY(A1)+1
Format the cell holding the formula as general.

Hope this helps
Rowan

if function for remaining days in month wrote:
Hi I need to know if anyone can give me an IF Function that will calculate
the number of days remaining in a given month. For example, if the date is
July 17th, the calculation would be 31-17+1=15 days. My problem is setting
the citeria to recognize whether the month is a 31 day month/30 day month or
28/29 day month (I would prefer not having to enter in that information for
each date). Please help! Thank you!



Ron Moore

Or more directly:

=DATE(YEAR(A1),MONTH(A1)+1,1)-A1

"Rowan" wrote:

Assuming you have entered your date in A1 then this formula should do it;
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))-DAY(A1)+1
Format the cell holding the formula as general.

Hope this helps
Rowan

if function for remaining days in month wrote:
Hi I need to know if anyone can give me an IF Function that will calculate
the number of days remaining in a given month. For example, if the date is
July 17th, the calculation would be 31-17+1=15 days. My problem is setting
the citeria to recognize whether the month is a 31 day month/30 day month or
28/29 day month (I would prefer not having to enter in that information for
each date). Please help! Thank you!





All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com