using if functions to perform multiple logical evaluations
I am needing to look at one cell to see if it has a specific word and then if it does use networkdays to calculate using two other cells. I am able to do this in excel, but unable to find the correct formula to do in smartsheet. Below is an example of what I used in creating it in excel.
=IF(ISNUMBER(SEARCH("clarity",$A$2)),IFERROR(NETWORKDAYS(B2,C2),""))
In smart sheet I the column name for (A2) in my excel example is Application. I need to know how many networdays it is taking from one stage to another.
Comments
-
Try one of these
=IF(CONTAINS("clarity", Application@row)=True, IFERROR(NETWORKDAYS([Date Column Title]@row, [Second Date Column Title]@row),""))
You'll need to replace Date Column Title with your actual date column and the Second date column title with the 2nd title. (You might have to put True in quotes). Unsure.
=IF(FIND("clarity", Application@row) > 0, IFERROR(NETWORKDAYS([Date Column Title]@row, [Second Date Column Title]@row),""))
Hope this helps!
-
You actually don't need to specify true when using CONTAINS like this.
=IF(CONTAINS(......., .................), IFERROR(.....................................))
Will work just fine. When using it this way, you only need to specify if you are searching for a false result in which case I personally use a NOT function instead of using false.
-
@Paul Good to know! I didn't have time to test it out so I thought i'd play it safe.
-
I use it quite a bit breaking down data from a roll-up into year-to-date metrics.
Another neat little observation...
Because it is a true/false output, it can be used as a stand-alone in checkbox columns or the flag type symbol column.
.
=IF(CONTAINS("text", [Column Name]@row) = true, 1, 0)
=IF(CONTAINS("text", [Column Name]@row), 1, 0)
=CONTAINS("text", [Column Name]@row)
.
They all function the same exact way when placed in a checkbox.
.
.
CONTAINS is also not case sensitive. The only two case sensitive functions that currently exist are FIND and HAS.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!