Variance Column Showing 1.. Needs to be 0! Help!

Bri Boyer
Bri Boyer
edited 12/09/19 inSmartsheet Basics

Hi all - I am working on a variance formula to first.. if error make a blank... and then to secondly... calculate the number of working days between to dates. I need the variance of our "planned end" and "actual end" columns. I have the formula just about right! But it is producing a 1 instead of zero when the dates match. Any suggestions on how to fix my formula?

=IFERROR(NETWORKDAYS([Planned End]29, [Actual End]29), "")



See screenshot below.

SS Variance Formula.JPG

Comments

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭
    edited 04/27/18

    嗯。奇数。我得到1当两个日期s are equal and it seems to be consistent. If I go a day early I get -2. Because the formula is always adding a full day, try this one:

    =IF(NETWORKDAYS([Planned End]29, [Actual End]29) < 0, NETWORKDAYS([Planned End]29, [Actual End]29) + 1, IF(NETWORKDAYS([Planned End]29, [Actual End]29) > 0, NETWORKDAYS([Planned End]29, [Actual End]29) - 1))

    That will return a 0 result on same day or the correct negative or plus result.

  • That looks like it's working! Now I need it to stay blank and not #INVALID DATA TYPE when the dates aren't inputted!

    Thanks so much Mike!

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭

    You can wrap the whole thing in an =IFERROR functions.

    =IFERROR(IF(NETWORKDAYS([Planned End]29, [Actual End]29) < 0, NETWORKDAYS([Planned End]29, [Actual End]29) + 1, IF(NETWORKDAYS([Planned End]29, [Actual End]29) > 0, NETWORKDAYS([Planned End]29, [Actual End]29) - 1)),"")

  • Yes thank you! One last thing - would I use the same formula in the parent rows? It doesn't appear to be calculating all variances below it.

    Sorry these formulas are above my knowledge. I appreciate the help.

  • Mike Wilday
    Mike Wilday ✭✭✭✭✭✭

    No, you'd need that formula in each row. but to create a summary of each one you could add =sum(children()) into the parent row and it would sum all the children or dependent tasks of the parent.

    See my screenshot for an example.

    2018-04-27_13-02-23.jpg

@ocanel<\/a> <\/p>

Excellent, and yes, I am too! Thanks!<\/p>

I'd recommend using Dynamic View.<\/p>

Share it with your company domain.<\/p>

When the user accesses it, they would only see their own submissions.<\/p>

More info.<\/p>

\n \n https:\/\/help.smartsheet.com\/learning-track\/integrations-and-add-ons\/dynamic-view\n <\/a>\n<\/div>

Would that work\/help?<\/p>

Remember! <\/strong>Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up\/Awesome or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":204,"urlcode":"Forms","name":"Forms"},{"tagID":324,"urlcode":"community-platform","name":"Community Platform"},{"tagID":334,"urlcode":"automations","name":"Automations"},{"tagID":440,"urlcode":"project-management","name":"Project Management"},{"tagID":448,"urlcode":"workflows-in-smartsheet","name":"Workflows in Smartsheet"}]},{"discussionID":108733,"type":"question","name":"Combining multiple IF(OR statements","excerpt":"I'm trying to combine these three functional IF(OR statements into a single working formula: =IF(OR(Webinar@row = \"Session 1|Afternoon\", Webinar@row = \"Session 1|Evening\"), \"08\/24\/2023\") =IF(OR(Webinar@row = \"Session 2|Afternoon\", Webinar@row = \"Session 2|Evening\"), \"08\/29\/2023\") =IF(OR(Webinar@row = \"Session 3|Afternoon\",…","snippet":"I'm trying to combine these three functional IF(OR statements into a single working formula: =IF(OR(Webinar@row = \"Session 1|Afternoon\", Webinar@row = \"Session 1|Evening\"),…","categoryID":321,"dateInserted":"2023-08-09T15:03:32+00:00","dateUpdated":null,"dateLastComment":"2023-08-09T15:39:06+00:00","insertUserID":154566,"insertUser":{"userID":154566,"name":"Draykov","url":"https:\/\/community.smartsheet.com\/profile\/Draykov","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/YUD6MF5OSNWQ\/nCTGFDW964F4K.png","dateLastActive":"2023-08-09T16:06:28+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":154566,"lastUser":{"userID":154566,"name":"Draykov","url":"https:\/\/community.smartsheet.com\/profile\/Draykov","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/YUD6MF5OSNWQ\/nCTGFDW964F4K.png","dateLastActive":"2023-08-09T16:06:28+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":42,"score":null,"hot":3383190758,"url":"https:\/\/community.smartsheet.com\/discussion\/108733\/combining-multiple-if-or-statements","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108733\/combining-multiple-if-or-statements","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":108733,"commentID":389831,"name":"Re: Combining multiple IF(OR statements","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/389831#Comment_389831","dateInserted":"2023-08-09T15:39:06+00:00","insertUserID":154566,"insertUser":{"userID":154566,"name":"Draykov","url":"https:\/\/community.smartsheet.com\/profile\/Draykov","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/YUD6MF5OSNWQ\/nCTGFDW964F4K.png","dateLastActive":"2023-08-09T16:06:28+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-09T15:33:00+00:00","dateAnswered":"2023-08-09T15:20:07+00:00","acceptedAnswers":[{"commentID":389820,"body":"

Hi @Draykov<\/a>,<\/p>

This is an easy fix - you have some brackets in the wrong place which is causing the IF statements to not be nested properly. When combining the individual IFs, the closing brackets should end up at the end of the combined statement, with a comma separating to make the false part of the IF statement, like so:<\/p>

=IF(OR(Webinar@row = \"Session 1|Afternoon\", Webinar@row = \"Session 1|Evening\"), \"08\/24\/2023\", IF(OR(Webinar@row = \"Session 2|Afternoon\", Webinar@row = \"Session 2|Evening\"), \"08\/29\/2023\", IF(OR(Webinar@row = \"Session 3|Afternoon\", Webinar@row = \"Session 3|Evening\"), \"08\/31\/2023\")))<\/p>

Give this a whirl and it should work for you - if there are still issues then post what error you're getting! 😊<\/span><\/p>"},{"commentID":389821,"body":"

Hey @Draykov<\/a>. Looks like it's just placement of parentheses! Try the below<\/p>

=IF(OR(Webinar@row = \"Session 1|Afternoon\", Webinar@row = \"Session 1|Evening\"), \"08\/24\/2023\", IF(OR(Webinar@row = \"Session 2|Afternoon\", Webinar@row = \"Session 2|Evening\"), \"08\/29\/2023\", IF(OR(Webinar@row = \"Session 3|Afternoon\", Webinar@row = \"Session 3|Evening\"), \"08\/31\/2023\")))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]},{"discussionID":108706,"type":"question","name":"How do I make a date turn red if past due and start actual is not checked?","excerpt":"","snippet":"","categoryID":321,"dateInserted":"2023-08-09T04:13:33+00:00","dateUpdated":null,"dateLastComment":"2023-08-10T01:31:52+00:00","insertUserID":164812,"insertUser":{"userID":164812,"name":"Tameka","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Tameka","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-10T01:31:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":164812,"lastUser":{"userID":164812,"name":"Tameka","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Tameka","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-10T01:31:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":34,"score":null,"hot":3383187325,"url":"https:\/\/community.smartsheet.com\/discussion\/108706\/how-do-i-make-a-date-turn-red-if-past-due-and-start-actual-is-not-checked","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108706\/how-do-i-make-a-date-turn-red-if-past-due-and-start-actual-is-not-checked","format":"Rich","lastPost":{"discussionID":108706,"commentID":389945,"name":"Re: How do I make a date turn red if past due and start actual is not checked?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/389945#Comment_389945","dateInserted":"2023-08-10T01:31:52+00:00","insertUserID":164812,"insertUser":{"userID":164812,"name":"Tameka","title":"Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Tameka","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-10T01:31:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/S0XMS03T3OF3\/screenshot-2023-08-08-at-9-11-04-pm.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Screenshot 2023-08-08 at 9.11.04 PM.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-10T07:37:55+00:00","dateAnswered":"2023-08-09T06:44:02+00:00","acceptedAnswers":[{"commentID":389683,"body":"

Hi Tameka,<\/strong> <\/p>

You can use conditional formatting to make a date turn red. Please you can take reference to the below screenshot.<\/p>

\n
\n \n \"MicrosoftTeams-image<\/img><\/a>\n <\/div>\n<\/div>\n

Please let me know if this works for you!<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=321&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":4936,"limit":3},"title":"Trending in Smartsheet Basics","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Smartsheet Basics