98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum 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
Resolved · Medium Priority · Version 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.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Page Break Preview in Excel 2010 (Hint/tip)If you select View then Workbook Views then Page Break Preview, you will be able to view how your Excel spreadsheet will be split across multiple pages when printed. Even better, you can also drag a page break to a new place. Excel will then scale down your entire worksheet to fit the information you want on the pages you want. |