How to add 6 months and minus 1 day from a date?

TeedyKay

New Member
Joined
Apr 13, 2011
Messages
3
I've been tasked at work to come up with a new workbook for our qualification of employees. Their qualification lasts 6 months minus 1 day

EG
Date Of Test = 16/01/11
Expiry Date = 15/07/11

Could anyone please help me with the formula to achieve the generation of an Expiry Date after inputting the Test Date?

I have tried the following:

=DATE(YEAR(TEST DATE),MONTH(TEST DATE)+6,DAY(TEST DATE)-1)

as recommended on a few sites and forums I have visited, however it has some major issues with it, it doesn't appear to be consistent.

Any help on this issue would be greatly appreciated.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the board...

You may have missplaced the -1
=DATE(YEAR(TEST DATE),MONTH(TEST DATE)+6,DAY(TEST DATE)-1)

Try like this instead

=DATE(YEAR(TEST DATE),MONTH(TEST DATE)+6,DAY(TEST DATE))-1

There's a big difference between the two.
 
Upvote 0
Or if you have the Analysis Toolpack from Tools - Addins

=EDATE(TEST DATE,6)-1


Perhaps the difference between the location of the -1 was not as huge as I initially thought.
 
Last edited:
Upvote 0
Alas, the analysis toolpack is not available to me at my place of work.

Attempted the change in the -1 but it still doesn't appear to be happening, for instance

TEST DATE = 01/08/11

EXP DATE = 31/01/12
 
Upvote 0
Ive not fully tested it but give this a go:

Code:
Public Function add6months(start_date As Date)

    Dim months(1 To 12) As Integer
    months(1) = 31
    months(2) = 28
    months(3) = 31
    months(4) = 30
    months(5) = 31
    months(6) = 30
    months(7) = 31
    months(8) = 31
    months(9) = 30
    months(10) = 31
    months(11) = 30
    months(12) = 31
    
    If Month(start_date) <= 6 And Year(start_date) Mod 4 = 0 Then months(2) = 29
    If Month(start_date) > 6 And Year(start_date) Mod 4 = 3 Then months(2) = 29
    
    For i = 1 To 6
        start_date = start_date + months(Month(start_date))
    Next i
    
    add6months = start_date - 1
End Function
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top