Forum Discussion

Rafael Benicio's avatar
Rafael Benicio
Brass Contributor
Nov 05, 2018

Sharepoint calculated column if date greater than another column

Hi guys, 

 

I have two fields on my Sharepoint list. One of them is called 'From Date' and another one called 'To Date'. How do I create a formula that validates if To Date is greater than From Date

 

I have tried this formula =[From Date]<[To Date] but it didn't work. 

 

I would be glad if someone could help me with this! Thanks!

  • Rafael Benicio's avatar
    Rafael Benicio
    Nov 06, 2018

    Hey Matt Weston

     

    I thought it was working but it's not! Just noticed, the validation is not working properly. 

     

    The formula that works is this one =[To Date]>=[From Date]. 

  • Matt Weston's avatar
    Matt Weston
    Iron Contributor

    Hi Rafael Benicio if you're looking at doing something with a calculated column then you could use a formula like this: 

     

    IF([End Date]>[Start Date],"Date Greater Than","Date Less Than")

     

    You could apply column formatting to this column to then show a visible difference between the TRUE and FALSE values.

     

    If you're looking to do column level validation, then unfortunately you can't compare two columns.

    • Rafael Benicio's avatar
      Rafael Benicio
      Brass Contributor

      Hi Matt Weston

       

      Thank you for your reply. Unfortunately, The formula below didn't work. 

       

      IF([To Date]>[From Date],"Date Greater Than","Date Less Than")

       

      Here is the error message:

       

      • Rafael Benicio's avatar
        Rafael Benicio
        Brass Contributor

        Matt Weston Never mind, I put the formula in the validation settings under list settings and it worked. 

         

        Thank you so much! Cheers! 

Resources