Home > SharePoint > Calculate Hours in SharePoint Calculated Column

Calculate Hours in SharePoint Calculated Column


It is a common formula for calculating days between two date column on SharePoint by using =DATEDIF([StartDate],[EndDate],’d), However there’s a date-time format on SharePoint column,e.g. 05/23/2011 7:00 AM to 05/23/2011 4:00 PM and we need to create a calculated column to count the difference in hour ? can we just use DATEDIF ? No , It won’t work! It is a little bit tricky but you could use the following function where…
[Start Time] column 05/23/2011 7:00 AM
[End Time] column 05/23/2011 4:00 PM
=IF(NOT(ISBLANK([End Time])),([End Time]-[Start Time])*24,0) -> it will give you 9 hour for differences

Advertisements
Categories: SharePoint
  1. Travis
    November 15, 2013 at 8:35 pm

    what about a formula for difference in minutes? i would assume its changing the end of that formula. I have yet to test it out but i think it would be something like the following:

    =IF(NOT(ISBLANK([End Time])),([End Time]-[Start Time])*24*60,0)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: