Computing.Net > Forums > Office Software > Excel If Statement + Dates

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Excel If Statement + Dates

Reply to Message Icon

Name: fopmhx
Date: April 22, 2009 at 03:08:44 Pacific
OS: Windows XP
Subcategory: Microsoft Office
Comment:

I have a set of dates in the format dd-mmm-yy in column a and have 2 conditions of jobs 1, 2 & 3 in column b.

I would like column c to:
- return the date in column a if the condition is 1
- add one month on if the condition is 2
- or add 3 months if the condition is 3

I've tried using an if statement, but have got very lost!



Sponsored Link
Ads by Google

Response Number 1
Name: Mike (by mmcconaghy)
Date: April 22, 2009 at 05:18:34 Pacific
Reply:

Try this in column C

=IF(B1=1,A1,IF(B1=2,A1+30,IF(B1=3,A1+90,0)))

Don't forget to format column C as Date

MIKE

http://www.skeptic.com/


0

Response Number 2
Name: DerbyDad03
Date: April 22, 2009 at 06:45:14 Pacific
Reply:

Some folks might not consider "30 days" as the definition of a month.

How about:

=IF(B1=1,A1,IF(B1=2,DATE(YEAR(A1),MONTH(A1)+1,DAY(A1)),IF(B1=3,DATE(YEAR(A1),MONTH(A1)+3,DAY(A1)),0)))


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Excel If Statement + Dates

Excel IF Statement Help Needed www.computing.net/answers/office/excel-if-statement-help-needed/7417.html

Microsoft Excel IF Statement www.computing.net/answers/office/microsoft-excel-if-statement/4444.html

Excel IF statements and conditional www.computing.net/answers/office/excel-if-statements-and-conditional/7035.html