none
Comparing numbers in Calculated Column formula, inside a simple OR Condition then IF Condition is not returning Correct Value in SharePoint RRS feed

  • Question

  • Simply trying to compare numbers in formula for calculated Column Total Days in Route. The numbers to be compared are returned by subtraction like

    TODAY()-[CurrentRouteDateTemp]

    where the column CurrentRouteDateTemp is of type Date

    See column descr:

    Why is it still just returning the value from the main calculation i.e.

    TODAY()-[CurrentRouteDateTemp]

    Why the rest of the condition not working????

    See list view:

    Friday, September 20, 2019 6:15 AM

Answers

  • I tested with below formula in my online site and it works. 

    =IF(OR(TODAY()-[CurrentRouteDateTemp]<0, TODAY()-[CurrentRouteDateTemp]>=43725), 0, TODAY()-[CurrentRouteDateTemp])


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    • Marked as answer by akg1421 Sunday, September 22, 2019 10:37 AM
    Friday, September 20, 2019 8:04 AM

All replies

  • I tested with below formula in my online site and it works. 

    =IF(OR(TODAY()-[CurrentRouteDateTemp]<0, TODAY()-[CurrentRouteDateTemp]>=43725), 0, TODAY()-[CurrentRouteDateTemp])


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    • Marked as answer by akg1421 Sunday, September 22, 2019 10:37 AM
    Friday, September 20, 2019 8:04 AM
  • Yes it seems to work when less/greater than <> is involved. Or following also works:

    or(value(TODAY()-[CurrentRouteDateTemp])=43725,value(TODAY()-[CurrentRouteDateTemp])<0)

    Don't forget to upvote the question. Thanks!

    Sunday, September 22, 2019 10:37 AM
  • Hi akg1421,

    Thanks for your sharing and confirm.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, September 23, 2019 5:42 AM