Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.

Question: Formula results in reports

Michael G.
Michael G. ✭✭
edited 12/09/19 inArchived 2017 Posts

Hi!

We use formulas in sheets.

When will the calculation be done?

Ony when having a sheet open?

Or also when using the column in a report?

In other words:

If the formular uses TODAY or s.th. like that, the result differs from day to day.

But is the result okay, when the sheet hasn´t been opened for a few days, but used in a report.

Sorry for thisCool

«1

Comments

  • Rob Hagan
    Rob Hagan ✭✭✭

    Hi Michael,

    We use TODAY() in all of our 50 or so active project sheets.

    We have many reports that extract data from those active project sheets.

    Our experience is that the formulas don't get re-evaluated just because a report touches an underlying sheet. SmartSheet appears to assume that an underlying sheet is fully evaluated when it extracts data from it.

    Consequently, I have written a Java program (using the SmartSheet-Java-API) to make an update to one nominated cell on every active project sheet at 5am every day and this has resolved our issue as it forces a full re-evaluation of each sheet that it "touches".

    The [Task Status] formula was the main one affected. It appears on every project sheet:

    ------------------------------------cut here

    =IF(OR([Row Type]1 = "Task", [Row Type]1 = "Milestone"), IF(OR(ISBLANK([Start Date]1), ISBLANK([End Date]1), NOT(ISDATE([Start Date]1)), NOT(ISDATE([End Date]1))), "Unscheduled", IF([% Complete]1 = 1, IF((TODAY() - DATEONLY([End Date]1)) < 7, "Completed Recently", "Completed"), IF(TODAY() > DATEONLY([End Date]1), "Overdue", IF(OR(ISBLANK([% Complete]1), [% Complete]1 = 0), IF(TODAY() < DATEONLY([Start Date]1), "Not Due To Start", "Not Yet Started"), IF(TODAY() < DATEONLY([Start Date]1), "In Progress Early", "In Progress"))))))

    ------------------------------------cut here

    You will notice that I use DATEONLY() to throw away the time information in the start and end dates so that the comparisons work correctly.

    I imagine that you have a similar formula in your implementation.

    Cheers,

    Rob.

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Hey Rob,

    Just so you know, DATEONLY() does not currently do anything.

    Support has said it might someday, so we don't want to deprecate it (paraphrased).

    But since I don't know what it will do when/if they ever make it do something, I've been removing them from formulas as I run across them.

    Let me know if your testing proves otherwise.

    Craig

  • Rob Hagan
    Rob Hagan ✭✭✭

    Hi Craig,

    I am seriously pissed of with SmartSheet this morning. To publish a behaviour in their official "these are our functions and how they operate" sheet and then to have it effectively do nothing (I did a quick test), and then to hear (thanks) that their support say "it may do something one day". Blah!

    One does not expect to have to prove that published, supported functions work as specified. I am not their beta tester!

    But, no damage putting it in as it will be important when they switch on time within their user accessibledatedata type which, given the history that I have observed, may be turned on with little notice.

    Thanks for being across this one... Legend.

  • Jason
    Jason Employee

    Hi Rob and Craig,

    This discussion caught my eye. I'm hoping to be able to shed some light on this side topic.

    I was surprised to see it said that DATEONLY() does nothing, so I did a little checking.

    Our helparticle states:

    "DATEONLY() will remove the time component of a date/time or system column cell."

    I have found the help article to be correct.

    I threw together some quick comparisons between functions with and without DATEONLY.

    Check out thispublished sheet

    This is not exhaustive or a deep explaination of how the function can be used in complex formulas. Its just a simple demo to show the function in action.

    What might be confusing and unclear is that boolean comparisons between DATE/TIME and DATE operands will strip time from the DATE/TIME operand automatically (Note the difference in types.) This is not the case when comparing DATE/TIME to DATE/TIME operands. This makes using DATEONLY in conjunction with comparators such as greater-than/less-than/equal unnecessary when one of the operands is a DATE.

    I believe this was done as part of the formula enhancement feature that was release in August 2016. Therelease notessay the following:

    "Smartsheet now manages and converts between types more deliberately.For example, in a formula that pulls the date and time from a Auto-Number/System column and a text in another, you will now see the combined date, time, and text; =(Modified1 + "new") you will get 08/06/16 11:54am new. The old function only included the date and text." (Emphasis mine)

    现在我不会说authoritively是否或not it will change in the future. But I can say that Smartsheet doesn't change formula functions without caution and extreme consideration of customer impact.

    Also, in my experience and understanding, if a formula is documented in the help articles, it is considered supported. There are some formulas that are undocumented, which if used is done at your own-risk.

    Hope this helps a little.

  • Rob Hagan
    Rob Hagan ✭✭✭
    edited 02/02/17

    Hi Jason,

    Good to hear that DATEONLY() operates as specified in the documentation. I unreservedly withdraw the negative comment that I made.

    Thanks for your investigation and explanation. I do intend to retain the DATEONLY() as it "future proofs" the code that I am writing against any change to the specification of type casting. I have only one place where TODAY() is used (althought that one place is propagated uniformly across all rows in the 50 or so active project sheets) so that's not a large imposition on my implementation.

    (Knowingly off thread, but raised from your example)

    I used your example to explore a bit more. What I did find interesting was that with Project Settings of an 8 hour day, and the Start Date of a task equal to the End Date of the same task, that the subtraction of Start Date from End Date gave 0.375 (9/24ths) rather than 0.3333... (8/24ths). On closer inspection it seems that an 8 hour day starts at 8am but finishes at 5PM (actually 4:59PM) and therefore lasts for 9 elapsed hours. Is this because a 1 hour lunch break is assumed?

    Cheers,

    Rob.

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Dammit - just lost my comment.

    I'll try again.

    My testing was centered around a single cell

    =Finish1 - DATEONLY(Finish1)

    should be 0.375

    but it isn't. It is 0.

    Row 21, I believe, returns an incorrect result as Start1 has a time component and DATEONLY(Modified1) does not. They should not be equal.

    If they are, the Finish1 = DATEONLY(Modified1) should also be true.

    (I'm curious how you got that result, I could not reproduce it)

    Rob's assumption is correct. Smartsheet assumes that a work-day of 4-16 hours starts at 8am. Workdays longer than 4 hours have a 1 hour break at noon.

    I tested this significantly when dealing with schedules that were planned down to the hours. I can't do that anymore. Maybe I can after studying your sheet further.

    Again, my testing was centered around a single Date/Time cell.

    What is most interesting to me is the result of Row 8 -- but for a single cell.

    And that no longer works.

    I contacted support about that and was told the DATEONLY function did not do anything anymore. That person was wrong, apparently.

    I believe that testing of Rob's formula may reveal that there is no difference between having it with and without DATEONLY, but I will leave that to someone else to test.

    Thanks for picking this up Jason.

    Craig

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    1. Very surprised to find that

    =(something) = (something else)

    works in a checkbox column.

    Pretty sure that used to throw an #UNPARSEABLE.

    Not sure I like it, but good to know.

    2. Here's the original posting:

    https://community.smartsheet.com/discussion/bug-comparing-maxsystem-date-system-date-returns-incorrect-result

    That is related to the time component of the Date/Time, not the date component.

    Craig

  • Jason
    Jason Employee

    In respons to Michael's original question.

    公式重新计算每一次变化aved to the sheet. Opening a report will not cause formulas to recalc on a sheets that are in the report. Rob has effectively worked around that by using the API to change a single cell in his sheets once a day, which causes a formula recalc on the changed sheets.

    Hope this helps.

  • Jason
    Jason Employee

    Hi Craig

    I think row 21 is correct. I mentioned this in my previous post, but I'll reword it: When using boolean operators, if one of the operands is a DATE type, and the other is DATE/TIME, the DATE/TIME is converted to a DATE type also (stripping the time component.) The result of DATEONLY(Modified1) is a DATE, which is then compared to a DATE/TIME (that being START1).

    Your assertion, that if Row 21 is true, then Finish1 = DATEONLY(Modified1) should also be true, is true. I've added it to my published test sheet.

    I didn't do anything fancy with the sheet. It is simply a new standard project sheet. Start and Finish are DATE/TIME columns. I renamed the 'Modified' column to 'Modified (Date) System Column' so it's type is clearer.

    Without digging in and researching, I agree that your single cell formula "= Finish1 - DATEONLY(Finish1)" appears to be wrong. I'll see what I can find out.

    As memory serves, Smartsheet didn't used to support formulas that used the equals operator in them such as '= 1 = 1' The Aug. 2016 release improved Smartsheets ability to calculate such formulas. Hence why not it works whereas before it would result in #UNPARSEABLE.

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Jason,

    Your first paragraph then implies that

    =DATEONLY(Start1) = Modified1

    I can not test at the moment because it is 10:50pm and

    when Modified is

    02/02/17 10:50 PM

    =DATEONLY(Modified1) + ""

    returns 02/03/17

    which was how I got here in the first place.

    Craig

  • Jason
    Jason Employee

    Craig

    So I just tested that and put it in my published sheet.

    "=DATEONLY(Start1) = Modified1" is also true. At least on my sheet.

    There might be some confusion caused by time zones. The DATE/TIME in project dependency columns does not consider user time zone. The DATE/TIME in system columns is presented in your local time. So in some cases 2 users looking at the same sheet will see different values in a system column. If you then use formulas on system columns you can get some interesting/unexpected results especially when combining users across multiple time zones. My head is hurting just thinking about it.

  • Hi Jason,

    thank you for coming back to my original questionSmile

    Bad news for me, because my construction to work with formulars using the TODAY-function in order to support REPORTS will not work ... I have to find another way (*optimistic*).

    Kind regards, Michael

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Michael -

    Sorry about derailing your thread. Really. I hate that and I apologize.

    I will post a new one and come back here to provide a link to it.

    Update:https://community.smartsheet.com/discussion/time-and-datetime-long

    Craig

  • Rob,

    Would there be a possibliity to get a copy of your Java program used for updated the fixed cell?

    We are using a =Today() formula combined with LOOKUP formulas linked to Sights Metrics to get event dashboards, but right now are having to have the first person each day to open and save the base sheet, which defeats the automation aspect.

    Thanks.

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭
    edited 09/17/17

    Caleb,

    While you wait for Rob to answer, for single sheets, I now use Zapier to solve this:

    http://ronin-global.com/2017/03/15/forcing-today-refresh-in-smartsheet/

    UPDATE: 2017-0917 - my solution has changed slightly and the post updated to reflect new method.

    Craig

This discussion has been closed.
Hi, <\/p>

Instead of applying the formula to \"Multiselect Text String\" row, did you tried with \"Multiselect Values\" row?<\/p>

=IF(HAS([Multiselect Values]@row, [Component ID]@row), \"MATCH\", \"NO MATCH\")<\/p>

Thank you,<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","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":[]},{"discussionID":109493,"type":"question","name":"I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","excerpt":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5 different statuses in a separate column. So using the screenshot I've provided as an example (although it doesn't have 5 different statuses in the…","snippet":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5…","categoryID":322,"dateInserted":"2023-08-25T20:03:21+00:00","dateUpdated":null,"dateLastComment":"2023-08-26T00:34:49+00:00","insertUserID":165710,"insertUser":{"userID":165710,"name":"SmarsheetNewb","url":"https:\/\/community.smartsheet.com\/profile\/SmarsheetNewb","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-26T00:33:27+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-26T01:04:51+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":22,"score":null,"hot":3386005690,"url":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109493,"commentID":392692,"name":"Re: I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392692#Comment_392692","dateInserted":"2023-08-26T00:34:49+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-26T01:04:51+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":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-26T00:33:25+00:00","dateAnswered":"2023-08-25T20:44:12+00:00","acceptedAnswers":[{"commentID":392662,"body":"

Try this:<\/p>

=COUNTIFS([Item Number]:[Item Number], OR(@cell = \"C001\", @cell = \"COO2\", @cell = \"COO3\", @cell = \"COO4\"), [Status]:[Status], OR(@cell = \"Green\", @cell = \"Yellow\", @cell = \"Red\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","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":109474,"type":"question","name":"Help with date calculation formula","excerpt":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the resolution date is blank I want it to use the current date in the calculation to see how long this issue has gone unresolved. Any help is much…","snippet":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the…","categoryID":322,"dateInserted":"2023-08-25T16:29:39+00:00","dateUpdated":"2023-08-25T16:29:59+00:00","dateLastComment":"2023-08-25T23:01:30+00:00","insertUserID":165688,"insertUser":{"userID":165688,"name":"Nwest","title":"Systems Analyst","url":"https:\/\/community.smartsheet.com\/profile\/Nwest","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!ukHVZ18ImX4!BcjWAe8S9SY!l7iQo_PZHOx","dateLastActive":"2023-08-25T17:22:30+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":165688,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":23,"score":null,"hot":3385987269,"url":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109474,"commentID":392687,"name":"Re: Help with date calculation formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392687#Comment_392687","dateInserted":"2023-08-25T23:01:30+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+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":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-25T17:04:22+00:00","dateAnswered":"2023-08-25T16:36:59+00:00","acceptedAnswers":[{"commentID":392622,"body":"

\n \n https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula\n <\/a>\n<\/div>\n

Hi, <\/p>

I hope you're well and safe!<\/p>

Try something like this.<\/p>

=IF([Date Reported]@row <> \"//www.santa-greenland.com/community/discussion/7133/\", IF([Resolution Date]@row = \"//www.santa-greenland.com/community/discussion/7133/\", NETDAYS([Date Reported]@row, TODAY()), NETDAYS([Date Reported]@row, [Resolution Date]@row)))<\/p>

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

I hope that helps!<\/p>

Be safe, and have a fantastic weekend!<\/p>

Best,<\/p>

Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p>

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":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","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"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&siteSectionID=0&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":10000,"limit":3},"title":"Trending Posts","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending Posts