Skip to main content

Hi!

Two formula questions - 

I have (4) different date fields with timestamps and need to identify the latest date across the four fields. When doing a Max value, it does not bring in the timestamp or makes it 12:00a as a standard. 

I also have (2) date fields that I need to calculate the datediff in hours and leaving the field blank if the second date field is empty instead of the NaN.

Please help! Thank you 🙂

Try these:

DATETIME_PARSE( MAX( IF( {Date 1}, VALUE( DATETIME_FORMAT( {Date 1}, 'x' ) ), 0 ), IF( {Date 2}, VALUE( DATETIME_FORMAT( {Date 2}, 'x' ) ), 0 ), IF( {Date 3}, VALUE( DATETIME_FORMAT( {Date 3}, 'x' ) ), 0 ), IF( {Date 4}, VALUE( DATETIME_FORMAT( {Date 4}, 'x' ) ), 0 ) ), 'x' )IF( AND( {Date 1}, {Date 2} ), DATETIME_DIFF( {Date 2}, {Date 1}, 'hours' ) )

Link to base


Try these:

DATETIME_PARSE( MAX( IF( {Date 1}, VALUE( DATETIME_FORMAT( {Date 1}, 'x' ) ), 0 ), IF( {Date 2}, VALUE( DATETIME_FORMAT( {Date 2}, 'x' ) ), 0 ), IF( {Date 3}, VALUE( DATETIME_FORMAT( {Date 3}, 'x' ) ), 0 ), IF( {Date 4}, VALUE( DATETIME_FORMAT( {Date 4}, 'x' ) ), 0 ) ), 'x' )IF( AND( {Date 1}, {Date 2} ), DATETIME_DIFF( {Date 2}, {Date 1}, 'hours' ) )

Link to base


I got the second one to work! The first is still not returning the timestamp


I got the second one to work! The first is still not returning the timestamp


What issue are you facing with it?  If you could provide a read-only invite link to a duplicated copy of your base with some example data I could take a look at this for you!


What issue are you facing with it?  If you could provide a read-only invite link to a duplicated copy of your base with some example data I could take a look at this for you!


Hi! I am so sorry, was on vacation... which may have helped because I realized it wasnt working since I had time off in the formatting 🙂 Thank you SO much!!