Sharepoint Calculated Column Formula for Date and Time Comparison

I have two columns C1 and C2, both date and time types in a document library. Now I want to create a computed column C3 with which I could know which column (C1 or C2) has the greatest value. I tried the following formula for the calculated IF column (C1> C2, 1,0), it works fine, but if I replace C1 with the "Modified" column, it doesn't seem to work. Please use different datetime values ​​for C2 to get 1,0,1,0 in the calculated column. I noticed that after 2-3 operations it stays at 1 or 0.

+1


a source to share


1 answer


Update I just tested it this way:

Create a list with three columns:

C1 - Date and Time    
C2 - Date and Time    
C3 - Calculated Column.

      

I configured a calculated column to return a number and entered the following formula into:

=IF(c1>c2,1,0)

      



It worked great.

If the calculated column is to return text (default) using the following formula:

=IF(c1>c2,"1","0")

      

Again, this works great for me.

+1


a source







All Articles