Mid-Month or End-of-Month

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Is there a function that will enable me to interpret the mid-month date
(15th) or end-of-month date?

In other words, if e.g. the date = "April 15, 2004", then show "true". If
however, the date is "April 30, 2004" then show "false".

Important though is that the end-of-month date can have 4 different values
(28th or 29th or 30th or 31st... depending on the given month).

Any thoughts?!

Thanks,
Tom
 
Tom,

Try something like the following formula, with the date in A1.

=IF(DAY(A1)=15,"mid-month",IF(DAY(A1)=DAY(DATE(YEAR(A1),MONTH(A1)
+1,0)),"end of month","false"))



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
One way

=IF(DAY(A1)=15,"Mid",IF(DAY(A1)=DAY(DATE(YEAR(A1),MONTH(A1)+1,0)),"End","Nei
ther mid nor end of the month"))

replace Mid and End with TRUE and FALSE (without quotation marks) if needed
 
Peo:

Great... it works fabulously!!!

Tom


Peo Sjoblom said:
One way

=IF(DAY(A1)=15,"Mid",IF(DAY(A1)=DAY(DATE(YEAR(A1),MONTH(A1)+1,0)),"End","Nei
ther mid nor end of the month"))

replace Mid and End with TRUE and FALSE (without quotation marks) if needed

--

Regards,

Peo Sjoblom
 
Is there a function that will enable me to interpret the mid-month date
(15th) or end-of-month date?

In other words, if e.g. the date = "April 15, 2004", then show "true". If
however, the date is "April 30, 2004" then show "false".

Important though is that the end-of-month date can have 4 different values
(28th or 29th or 30th or 31st... depending on the given month).

Any thoughts?!

Thanks,
Tom

To check for the end of month:

=DAY(A1+1)=1

To check for mid month:

=DAY(A1)=15

These formulas will return TRUE if END OF MONTH or MID-MONTH respectively.

So, depending on how you want to use the results:

According to what you wrote, you want to return TRUE if the date is April 15,
2004 but return FALSE if the date is April 30, 2004 (and END OF MONTH date).

You don't say what you want to return if the date is neither.

=IF(DAY(A1+1)=1,FALSE,IF(DAY(A1)=15,TRUE," undefined"))


--ron
 
for end of month u can use the funciton called
EOMONTH(start_date,months)

for your this function will useful with a short formula.

this will takecare of # of days in that particular month eg : 31,30,2
or 28

Plz let me know.. whether its useful for you.



with regds
cn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top