Month Formula

  • Thread starter Thread starter Sarah
  • Start date Start date
S

Sarah

I would like to create a formula that takes a date in cell C4 and adds four
months to it - please help!

(sorry if this posted twice - i just wanted to make sure it got through)
 
Try this....

=DATE(YEAR(C4),MONTH(C4)+4,DAY(C4))

You may want to look at what happens when you add 4 months to a date whose
day value is more than the last day of the month four months hence. For
example, what should you get when you add four months to October 30th of any
year?

Rick
 
Your second formula is just =D4+121, so doesn't really do the job very well.
The one you added in your later post seems better.
 
Ok, that works great in xcel - what if I want to use this function in a query
in access - i get the error message "the expression you entered has a
function containing the wrong number of arguments". The exact query i am
using is:

=DATE(YEAR( [Employee Information Master]![Original Hire Date] ),MONTH(
[Employee Information Master]![Original Hire Date] )+4,DAY( [Employee
Information Master]![Original Hire Date] ))
 
I'm afraid I have almost no experience with Access, so you will have to wait
until someone with such familiarity comes along and responds to your
message.

Rick


Sarah said:
Ok, that works great in xcel - what if I want to use this function in a
query
in access - i get the error message "the expression you entered has a
function containing the wrong number of arguments". The exact query i am
using is:

=DATE(YEAR( [Employee Information Master]![Original Hire Date] ),MONTH(
[Employee Information Master]![Original Hire Date] )+4,DAY( [Employee
Information Master]![Original Hire Date] ))
Rick Rothstein (MVP - VB) said:
Try this....

=DATE(YEAR(C4),MONTH(C4)+4,DAY(C4))

You may want to look at what happens when you add 4 months to a date
whose
day value is more than the last day of the month four months hence. For
example, what should you get when you add four months to October 30th of
any
year?

Rick
 
Sarah,

The Date() function in XL is equivalent to the DateSerial() function in AC.

So, change...

=DATE(YEAR( [Employee Information Master]![Original Hire
Date] ),MONTH([Employee Information Master]![Original Hire Date] )+4,DAY(
[Employee Information Master]![Original Hire Date] ))

....to...

=DATESERIAL(YEAR( [Employee Information Master]![Original Hire
Date] ),MONTH([Employee Information Master]![Original Hire Date] )+4,DAY(
[Employee Information Master]![Original Hire Date] ))

Hopefully that will work for you,

Conan




Sarah said:
Ok, that works great in xcel - what if I want to use this function in a
query
in access - i get the error message "the expression you entered has a
function containing the wrong number of arguments". The exact query i am
using is:

=DATE(YEAR( [Employee Information Master]![Original Hire Date] ),MONTH(
[Employee Information Master]![Original Hire Date] )+4,DAY( [Employee
Information Master]![Original Hire Date] ))
Rick Rothstein (MVP - VB) said:
Try this....

=DATE(YEAR(C4),MONTH(C4)+4,DAY(C4))

You may want to look at what happens when you add 4 months to a date
whose
day value is more than the last day of the month four months hence. For
example, what should you get when you add four months to October 30th of
any
year?

Rick
 
Back
Top