Solved

Show Jan 15 and July 15 of each year

Posted on 2014-09-24
15
95 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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 32

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
 

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 32

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 32

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 32

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dropbox in Windows Server 2008 4 33
Excel - Data Validation 3 31
Excel IF formula 3 22
If a cell in a range equals "YES" return specific Test. 4 34
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

831 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