Solved

Show Jan 15 and July 15 of each year

Posted on 2014-09-24
15
99 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 26

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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 33

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 33

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 33

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 33

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
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…

828 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