Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

if formula add dates

Forum home » Delegate support and help forum » Microsoft Excel Training and help » If formula to add dates in future dependant on text values

If formula to add dates in future dependant on text values

ResolvedVersion 2007

Shaun has attended:
Excel Intermediate course

If formula to add dates in future dependant on text values

Hello,

Having a little trouble putting together a formula to add dates in future, dependant on text values in a cell.

I need the formula to read

If P2 = "XX" then Q2 = P2 +28, but if P2= "YY" or "ZZ" then Q2 = P2 +56, or if P2 = " " the Q2 = " "

so one text indicator means add 28 day, two different other indicatiors = add 56 days, and if the cell is blank no date is entered?

How is this done?

Many thanks,

Shaun

RE: If formula to add dates in future dependant on text values

Hi Shaun

Thanks for getting in touch. On the Intermediate course you probably dealt with a simple IF function. To do what you need, you require the nested IF function. This means to add an IF function inside an IF function. You would also need to use an OR function. Assuming the formula is being written in Q2 it will look something like this:

=IF(P2="XX",P2+28,IF(OR(P2="YY",P2="ZZ"),P2+56,IF(P2="","")))

You can find out more information about nesting an IF function and using the OR function on our Advanced Excel course.

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Fri 2 Nov 2012: Automatically marked as resolved.

Excel tip:

Quick Absolute Cell References

When entering cell references in a formula you probably click the cell, or you may type in the cell reference. If you require any of the 4 variations, press the F4 key now before you press Enter to toggle around the relative and absolute entries ($signs).

Note that the F4 key outside of editing a formula is the Repeat key to repeat a previous action.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.14 secs.