I'm attempting to create an If formula with multiple IFs but I get stuck at how to add a 3rd if
![Earl P](https://us.v-cdn.net/6031209/uploads/defaultavatar/nWRMFRX6I99I6.jpg)
Hi all i'm attempting to have a column auto update a date column based on certain criteria and using If statements to do so. My only issue is that i'm trying to incorporate a 3rd IF statements as there are 3 levels of condition to apply. See formula below
=IF(Tier@row = 1, (IFERROR(DATE(YEAR([Last Updated]@row), MONTH([Last Updated]@row) + 3, DAY([Last Updated]@row)), DATE(YEAR([Last Updated]@row) + 1, MONTH([Last Updated]@row) - 3, DAY([Last Updated]@row)))), IF(Tier@row = 3, (IFERROR(DATE(YEAR([Last Updated]@row), MONTH([Last Updated]@row) + 12, DAY([Last Updated]@row)), DATE(YEAR([Last Updated]@row) + 1, MONTH([Last Updated]@row), DAY([Last Updated]@row)))))),IF(Tier@row = 2, (IFERROR(DATE(YEAR([Last Updated]@row), MONTH([Last Updated]@row) + 6, DAY([Last Updated]@row)), DATE(YEAR([Last Updated]@row) + 1, MONTH([Last Updated]@row) - 6, DAY([Last Updated]@row))))))
I'm ok when entering up to 2 since the IF function has the otherwise portion but i'm confused as to what function I should use to get the 3rd part in. Not too knowledgeable on nest IF statements
Answers
-
Tried also using this
=OR(IF(Tier@row = 1, (IFERROR(DATE(YEAR([Last Updated]@row), MONTH([Last Updated]@row) + 3, DAY([Last Updated]@row)), DATE(YEAR([Last Updated]@row) + 1, MONTH([Last Updated]@row) - 3, DAY([Last Updated]@row)))), IF(Tier@row = 3, (IFERROR(DATE(YEAR([Last Updated]@row), MONTH([Last Updated]@row) + 12, DAY([Last Updated]@row)), DATE(YEAR([Last Updated]@row) + 1, MONTH([Last Updated]@row), DAY([Last Updated]@row)))))), IF(Tier@row = 2, (IFERROR(DATE(YEAR([Last Updated]@row), MONTH([Last Updated]@row) + 6, DAY([Last Updated]@row)), DATE(YEAR([Last Updated]@row) + 1, MONTH([Last Updated]@row) - 6, DAY([Last Updated]@row))))))
-
Hello @Earl P
This is the working formula, you had additional brackets in there.
When working with big IFs it can help to break them down in notepad for example so you can review line by line, they can then be pasted back into smartsheet and will work correctly (providing all the references etc. are correct)
=IF(Tier@row = 1, IFERROR(DATE(YEAR([Last updated]@row), MONTH([Last updated]@row) + 3, DAY([Last updated]@row)), DATE(YEAR([Last updated]@row) + 1, MONTH([Last updated]@row) - 3, DAY([Last updated]@row))), IF(Tier@row = 2, IFERROR(DATE(YEAR([Last updated]@row), MONTH([Last updated]@row) + 6, DAY([Last updated]@row)), DATE(YEAR([Last updated]@row) + 1, MONTH([Last updated]@row) - 6, DAY([Last updated]@row))), IF(Tier@row = 3, IFERROR(DATE(YEAR([Last updated]@row), MONTH([Last updated]@row) + 12, DAY([Last updated]@row)), DATE(YEAR([Last updated]@row) + 1, MONTH([Last updated]@row), DAY([Last updated]@row))), "Error")))
You also needed to cap the last IF statement so used "Error", this was the result.
Hope that helps
Paul
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.5K Get Help
- 448 Global Discussions
- 145 Industry Talk
- 481 Announcements
- 5.1K Ideas & Feature Requests
- 85 Brandfolder
- 152 Just for fun
- 73 Community Job Board
- 492 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 304 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!