Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Test to see if date was the last day of month

Posted on 2013-06-12
3
Medium Priority
?
376 Views
Last Modified: 2013-06-12
I need a formula to return a 1 if the date (lets say  A1) was the last day of the month or a 0 if it was not. I have a long list of dates and I just need to pull out the month end dates from each range.
0
Comment
Question by:wilpitz
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 2000 total points
ID: 39242857
Use this formula:

=IF(DATE(YEAR(A1),MONTH(A1)+1,0)=A1,1,0)

Kevin
0
 

Author Closing Comment

by:wilpitz
ID: 39242865
That did it!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 39242866
If A1 is the last day of the month then the next day will be the 1st, so you can just test that, i.e.

=IF(DAY(A1+1)=1,1,0)

regards, barry
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question