Solved

Show Jan 15 and July 15 of each year

Posted on 2014-09-24
15
91 Views
Last Modified: 2014-09-24
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
0
Comment
Question by:pdvsa
  • 8
  • 4
  • 2
  • +1
15 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40341940
=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)

Open in new window

0
 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 40341944
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
0
 

Author Comment

by:pdvsa
ID: 40341986
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.
0
 

Author Closing Comment

by:pdvsa
ID: 40341987
thank you
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40341991
=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)

Open in new window

0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40342015
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
0
 

Author Comment

by:pdvsa
ID: 40342040
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.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:pdvsa
ID: 40342067
how would I modify to subtract a month and 15 days?  
=EOMONTH(TODAY(),IF(MONTH(TODAY())<7,6,12)-MONTH(TODAY()))+15
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40342074
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
0
 

Author Comment

by:pdvsa
ID: 40342077
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
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40342085
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
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40342110
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
0
 

Author Comment

by:pdvsa
ID: 40342247
Rob thank you... Yes, u need the 15th only and no other date.
0
 

Author Comment

by:pdvsa
ID: 40342261
I need.. Typo from cell
0
 

Author Comment

by:pdvsa
ID: 40342373
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now