I have three columns - a start date/time, an end date/time, and a duration. I found a guide for setting up the duration column to calculate plain text based on the time/date columns, but something in the syntax appears to glitch on a few of the items that last precisely one hour.
Can anyone help me spot the error here? This is the formula I'm using.
=CONCATENATE(IF(INT(([End Date and Time]-[Start date and time])*24)>0,CONCATENATE(INT(([End Date and Time]-[Start date and time])*24)," ",IF(INT(([End Date and Time]-[Start date and time])*24)>1,"hours","hour")),""),IF(MINUTE([End Date and Time]-[Start date and time])>0,CONCATENATE(" ",MINUTE([End Date and Time]-[Start date and time])," ",IF(MINUTE([End Date and Time]-[Start date and time])>1,"minutes","minute")),""))
Same formula, more readable.
=CONCATENATE(
IF(INT(([End Date and Time]-[Start date and time])*24)>0,
CONCATENATE(
INT(([End Date and Time]-[Start date and time])*24),
" ",
IF(INT(([End Date and Time]-[Start date and time])*24)>1,
"hours",
"hour"
)
),
""
),
IF(MINUTE([End Date and Time]-[Start date and time])>0,
CONCATENATE(
" ",
MINUTE([End Date and Time]-[Start date and time]),
" ",
IF(MINUTE([End Date and Time]-[Start date and time])>1,
"minutes",
"minute"
)
),
""
)
)
Thanks!