# Show Jan 15 and July 15 of each year

Experts,

What would be the formula to show the next date of either Jan 15 or July 15?
Example:  formula should return Jan 15, 2015 and then once that date is passed then will show July 15, 2015.

hope that makes sense.  Please ask to explain in more detail if need be.

thank you
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Director, Practice Manager and Computing ConsultantCommented:
``````=DATE(YEAR(NOW()),CHOOSE(MONTH(NOW()),IF(DAY(NOW())>15,7,1),7,7,7,7,7,IF(DAY(NOW())>15,13,7),13,13,13,13,13),15)
``````

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Microsoft Excel ExpertCommented:
type

in A1  1/15/2015
and in A2 7/15/2015
select both of the cells and drag them down and you will see the series is created
Project financeAuthor Commented:
Philip:  you are good.

I have a simple follow up.  Would you mind to tell me how I could subtract 1 month and 15 days from that formula?  I tried and I dont really know where to put the criteria in such a long formula.   thank you

Professor: nice and simple.  I could make that work but would need a table and lookup.  I only am wanting a single cell that shows the date.
Project financeAuthor Commented:
thank you
Director, Practice Manager and Computing ConsultantCommented:
``````=DATE(YEAR(NOW()),CHOOSE(MONTH(NOW()),IF(DAY(NOW())>15,6,0),6,6,6,6,6,IF(DAY(NOW())>15,12,6),12,12,12,12,12),0)
``````
Finance AnalystCommented:
Try this formula:

=EOMONTH(B2,IF(MONTH(B2)<7,6,12)-MONTH(B2))+15

Where B2 contains a date for comparison. If you want it to compare to today:

=EOMONTH(TODAY(),IF(MONTH(TODAY())<7,6,12)-MONTH(TODAY()))+15

EOMONTH creates a date for the End of Month, syntax is:

=EOMONTH(Date, Months)  where months is number of months forward (or back)

The comparison of month for TODAY with 6 or 12 determines how many months to go forward.

Thanks
Rob H
Project financeAuthor Commented:
Rob: would that formula
=EOMONTH(TODAY(),IF(MONTH(TODAY())<7,6,12)-MONTH(TODAY()))+15

always return either the 15 of jan or july and not some other day (maybe the 16 or 14 etc etc)  because some months have 30, 31 days etc.
Project financeAuthor Commented:
how would I modify to subtract a month and 15 days?
=EOMONTH(TODAY(),IF(MONTH(TODAY())<7,6,12)-MONTH(TODAY()))+15
Finance AnalystCommented:
It would always return the 15th of the month, except for flaw corrected with below:

=EOMONTH(TODAY(),IF(AND(DAY(TODAY())<16,OR(MONTH(TODAY())=1,MONTH(TODAY())=7)),-1,IF(MONTH(TODAY())<7,6,12)-MONTH(TODAY())))+15

EOMONTH always round to the last day of a month regardless of number of days, last day of a month plus 15 is always the 15th of the next month.

Correction was to overcome dates between 1st & 15th Jan or 1st & 15th July rounding up to the next occurence of 15th of Jan or July.

Thanks
Rob H
Project financeAuthor Commented:
I dont think the above EOMONTH is subtracting out a month and 15 days but I see -MONTH in the formula so it looks like it should but the return is Jan 15, 2015 but shouldl be Nov 30 2014
Finance AnalystCommented:
Do you want the 15th of Jan / 15th of July?

OR

Do you want 30th November (1 month & 15 days prior to 15th Jan) / 31 May (1 month & 15 days prior to 15th July)?

Thanks
Rob H
Finance AnalystCommented:
Just to clarify, my post was posted before I realised the requirement to deduct 1 month and 15 days so the formula did not allow for that.

The -MONTH that you refer to was to calculate how many months to go forward to always end at Jan or July.

For example, currently in September, therefore
12 - MONTH(TODAY())
gives 12 - 9 = 3

leads to EOMONTH(TODAY(), 3) which gives end of December, then plus 15 gives 15 Jan.

Example prior to July (month 7) eg May

6 - MONTH(DateInMay)
6 - 5 = 1

leads to EOMONTH(DateInMay,1) which gives end of June, then plus 15 gives 15 July.

The 12 or the 6 in the above examples was determined by an IF statement based on current month being less than 7.

Thanks
Rob H
Project financeAuthor Commented:
Rob thank you... Yes, u need the 15th only and no other date.
Project financeAuthor Commented:
I need.. Typo from cell
Project financeAuthor Commented:
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.