Common Date Time formulas for Sharepoint – Calculated Fields

Get Week of the year
=DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time]))+0.5-WEEKDAY(DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])),2)+1

First day of the week for a given date:
=[Start Date]-WEEKDAY([Start Date])+1

Last day of the week for a given date:
=[End Date]+7-WEEKDAY([End Date])

First day of the month for a given date:
=DATEVALUE(“1/”&MONTH([Start Date])&”/”&YEAR([Start Date]))

Last day of the month for a given year (does not handle Feb 29). Result is in date format:
=DATEVALUE (CHOOSE(MONTH([End Date]),31,28,31,30,31,30,31,31,30,31,30,31) &”/” & MONTH([End Date])&”/”&YEAR([End Date]))
Day Name of the week : e.g Monday, Mon
=TEXT(WEEKDAY([Start Date]), “dddd”)
=TEXT(WEEKDAY([Start Date]), “ddd”)


The name of the month for a given date – numbered for sorting – e.g. 01. January:

=CHOOSE(MONTH([Date Created]),”01. January”, “02. February”, “03. March”, “04. April”, “05. May” , “06. June” , “07. July” , “08. August” , “09. September” , “10. October” , “11. November” , “12. December”)

Get Hours difference between two Date-Time :
=IF(NOT(ISBLANK([End Time])),([End Time]-[Start Time])*24,0)

Date Difference in days – Hours – Min format : e.g 4days 5hours 10min :
=YEAR(Today)-YEAR(Created)-IF(OR(MONTH(Today)<MONTH(Created),AND(MONTH(Today)=MONTH(Created),
DAY(Today)<DAY(Created))),1,0)&” years, “&MONTH(Today)-MONTH(Created)+IF(AND(MONTH(Today)
<=MONTH(Created),DAY(Today)<DAY(Created)),11,IF(AND(MONTH(Today)<MONTH(Created),DAY(Today)
>=DAY(Created)),12,IF(AND(MONTH(Today)>MONTH(Created),DAY(Today)<DAY(Created)),-1)))&” months,
“&Today-DATE(YEAR(Today),MONTH(Today)-IF(DAY(Today)<DAY(Created),1,0),DAY(Created))&” days”

You can get Get more formulas from
http://office.microsoft.com/en-us/sharepointtechnology/HA011609471033.aspx

OR

http://msdn.microsoft.com/en-us/library/bb862071.aspx

104 Comments

  1. Henrik said,

    June 11, 2009 at 1:13 PM

    How can you extract the current month in MOSS e.g. if you want to make a birthdaylist of this month’s birthdays?

  2. July 5, 2009 at 7:46 PM

    Great tip. Some useful formulas there mate.
    Keep it up.

  3. João Cabrita said,

    July 17, 2009 at 3:56 PM

    Hey guys, I could not get this last formula to work in my project. So I came up with a solution that will get you the difference between a date (with time also) and correctly take care of some problems I saw in other solutions (for instance having less than a day in hours difference). Hope you will find it useful!

    =IF(HOUR([Ending Date])>HOUR([Starting Date]),DATEDIF([Starting Date],[Ending Date],”d”)&” days “&HOUR([Ending Date]-[Starting Date])&” hours “,(DATEDIF([Starting Date],[Ending Date],”d”)-1)&” days “& HOUR([Ending Date]-[Starting Date])&” hours “)&MINUTE([Ending Date]-[Starting Date])&” minutes”

  4. July 20, 2009 at 9:47 AM

    […] Common Date Time formulas for Sharepoint – Calculated Fields Formula examples to calculate date and time in calculated fields […]

  5. JB said,

    August 5, 2009 at 2:15 PM

    Heya,

    great post; thanks for those formulas. I’ve made a slight edit to your “First day of the week” one to get it to use Monday as the first day of the week, even if given the following Sat or Sun, which I thought I’d post back incase it’s of use to anyone else (since just adding 2 instead of 1 didn’t work the way I’d hoped for weekends, and I didn’t want to overcomplicate the formula):

    =[Start Date]-WEEKDAY([Start Date],3)

    More info on this function can be found here:
    http://office.microsoft.com/en-us/help/HA011610981033.aspx

    Thanks again,

    JB

  6. Catherine said,

    September 30, 2009 at 5:38 PM

    Our fiscal year runs from Oct.1 – Sept. 30. On Oct 1 we have to start renumbering items at 1 (ie. XX# 1-10; the 10 indicates the new fiscal year). I want to use [created date] if month = 01-09; and [created date] +1 if month = 10-12. How do I build that formula. HELP!!!!

    • Jill said,

      May 12, 2010 at 3:04 AM

      I would like to know if you ever got an answer to your question. I also would like to be able to assign items in a list to a fiscal year that isn’t Jan. 1.

  7. January 11, 2010 at 7:38 PM

    Hi, this year (2010) starts on a friday, therefore you can take away the +1 to get the actual weeknumer, another way will be to store a number for the starting day in this year and make an extension in the calculating.

  8. Alicia said,

    February 3, 2010 at 7:50 PM

    Is there a way to calculate the difference of a start date and current date?

    Thanks

  9. HyVong said,

    February 23, 2010 at 9:39 PM

    Further to the formula above.
    Using these formulas, you are assuming the week starts from Sunday to Saturday
    First day of the week for a given date:
    =[Start Date]-WEEKDAY([Start Date])+1

    Last day of the week for a given date:
    =[End Date]+7-WEEKDAY([End Date])

    If you want your week to start from Monday to Sunday, include an extra parameter value to your WEEKDAY() function

    First day of the week for a given date:
    =[Start Date]-WEEKDAY([Start Date],2)+1

    Last day of the week for a given date:
    =[End Date]+7-WEEKDAY([End Date],2)

    HyVong

    • Tom said,

      June 30, 2010 at 9:47 PM

      HyVong,

      Thanks for this reply post and thanks for everyone’s help! I was wondering if you could give me the formula to make the week number (you know, the column that says “Week” and has the calculated formula of “=DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time]))+0.5-WEEKDAY(DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])),2)+1”) be so that it shows the start date as a Thursday, not a Monday.

      I’m new with all of this stuff so I think your post is helpful but do not know how to apply it to my own situation. Any help is appreciated.

  10. Dany said,

    February 26, 2010 at 3:52 AM

    I created a column called End date with a date/time value of todays date. Then i created another column call Saturday with a date/time value and the calculated value of “=[End Date]+7-WEEKDAY([End Date])” but when I hit create column it says error “The formula contains reference(s) to field(s). ”

    What am I doing wrong?

  11. Brad said,

    February 26, 2010 at 10:18 AM

    Dany the column you create must be a claculated value. I made the same mistake myself recently.

  12. Scott said,

    March 6, 2010 at 12:01 AM

    How can I calculate the due date on a project task list if all I have is a start date and duration (days) for the task? I have to filter out the weekends instead of just adding a number of days to a start date.

    In most examples, I have only seen where they calculate the number of work days between a [start date] and [completed date]. For example: http://levithan.com/?p=49

    Any suggestions?

  13. sohail said,

    March 12, 2010 at 10:27 AM

    Excellent article and very helpful. Thank you very much.

  14. Chetan said,

    March 24, 2010 at 10:39 PM

    You can also check for an error in a formula before applying it. For example, if I wanted to calculate a difference of two dates and my calculation is as below:

    DATEDIF(CreatedDate,[ResolutionDate],”d”)

    Now, lets say if the “ResolutionDate” is blank initially, the calculation above would give an error. The calculation can be updated to be:

    =IF(ISERROR(DATEDIF([CreatedDate],[ResolutionDate],”d”)),””,DATEDIF([CreatedDate],[Resolution Date],”d”))

  15. Hemasree said,

    March 30, 2010 at 4:26 PM

    I want to find the difference between a given End Date and Current Date including Time difference.

    Wheneva i use any of de given formulae i get de following error message “Calculated columns cannot contain Volatile columns like Today and Me”

    Kindly help. its important for me to know. Wat to do?

    I am using WSS 3.0

  16. Scott said,

    March 30, 2010 at 7:11 PM

    Yep – that’s a function that doesn’t work unless you first create a dummy column called TODAY and delete it afterwards. That column must be present whenever you make modifications to your column, so leave it in place until you get the formula mastered.

    More Info: http://blogs.msdn.com/cjohnson/archive/2006/03/16/552314.aspx

  17. Maria87 said,

    March 31, 2010 at 12:35 PM

    Would you help me please?

    I want to calculate to difference between two times in a sharepoint list. The first is a column named start date i have created and the second is a column named end date (i have created also) .

    the calculation should be done from these two columns to a new column field name response time i have created also.

    The display of the result should be as follow: number of days, hours, minutes, and seconds.

    Also It should not count the weekends, knowing that a weekend is Saturday and Sunday. So the count should be only on working days:

    ie:

    startdate: 24/03/2010 2:15 pm

    enddate: 29/03/2010 1:24 pm

    PS: the start date here is a wednesday and the end date is a monday, so the weekend in between should not be counted.

    the display to be above exemple should be: 2 days, 23 hours, 8 minutes, 21 seconds.

    i am insisting on showing the hours, minutes and seconds also because sometimes the start and end date are separated by only few seconds, or only few minutes, or only few hours or only few days, or the combination of some, or the combination of all of them.

    Thank you…

    • Sunil said,

      September 30, 2011 at 6:44 AM

      Hi.. Are you able to get the differance including the weekend?

  18. Richard said,

    June 7, 2010 at 5:11 AM

    Can anyone help/

    I need the below formula to give a result of ” NOT COMPLETED” On error, if the Completed Date Field is blank?

    =(DATEDIF(Created,[Completed Date],”D”))-INT(DATEDIF(Created,[Completed Date],”D”)/7)*2-IF((WEEKDAY([Completed Date])-WEEKDAY(Created))<0,2,0)+1

    I have other if iserror codes on other columns and they work, i have tried the below but get an error

    =IF(ISERROR(DATEDIF(Created,[Completed Date],"D"))-INT(DATEDIF(Created,[Completed Date],"D")/7)*2-IF((WEEKDAY([Completed Date])-WEEKDAY(Created))<0,2,0)+1)),"NOT COMPELTED",(DATEDIF(Created,[Completed Date],"D"))-INT(DATEDIF(Created,[Completed Date],"D")/7)*2-IF((WEEKDAY([Completed Date])-WEEKDAY(Created))<0,2,0)+1))

  19. Daphne said,

    July 7, 2010 at 1:16 AM

    I used
    =YEAR(Created)

    in a calculated field to extract the year from the created date of an item.
    This works fine except it displays the year as 2,010 instead of 2010. How can I remove the comma so it will display correctly.

  20. July 7, 2010 at 7:31 AM

    […] Tháng Bảy 7, 2010 vinhphampro Để lại phản hồi Go to comments Common Date Time formulas for Sharepoint – Calculated Fields […]

  21. MSG said,

    July 23, 2010 at 8:08 AM

    I’m trying to build a list to track my walks. I’d like to be able to calculate my pace in minutes and seconds. I can make it work in excel, but i’m not sure how to use TEXT function along with time to get it to work. Any suggestions? Example: I walk 3.720 miles in 52 minutes 15 seconds. I know I’d need to find percent fraction 15/60, but not sure how to go about in sharepoint. In excel pace would be 14 minutes, 11 seconds and .9 tenths.

  22. Larry said,

    August 5, 2010 at 12:06 AM

    Fairly great job on the formulas. I was playing around with the last day of the month. First question why were you using datevalue. this returns a serial number, not a date. Any way I made a modification and now it also returns accurate last day for both non leap and leap years. here you go:

    =DATE(YEAR([End Date]),MONTH([Date1]),CHOOSE(MONTH([End Date]),31,IF(MOD(YEAR([End Date]),4)=0,29,28),31,30,31,30,31,31,30,31,30,31))

    this formula will return a date in date firmat, and it will return the accurate last day.

    • sfmp said,

      November 24, 2010 at 3:42 PM

      When I use this formula it returns the serial number not the actual date?? I’m using the Created column for “End Date” but what are you using for “Date 1”?
      Thanks.

      • sfmp said,

        November 24, 2010 at 3:54 PM

        S’alright. I added another calculated column to convert the serial date!

      • larry said,

        November 24, 2010 at 11:55 PM

        it should not be in serial format. the DATE formula is in date format. My Date 1 field is a date field, that allowed user input of date.

      • larry said,

        November 24, 2010 at 11:56 PM

        you may need to set your CC “Date and Time” Date only.

  23. Sreedhar said,

    September 3, 2010 at 2:18 PM

    Hi,
    Using the below formula we can calculate Difference between two dates except Saturday and Sunday.

    =IF(AND((WEEKDAY([Date To],2))1),(((DATEDIF([Date From],[Date To],”D”)+1))-(FLOOR((DATEDIF([Date From],[Date To],”D”)+1)/7,1)*2)-2),(((DATEDIF([Date From],[Date To],”D”)+1))-(FLOOR((DATEDIF([Date From],[Date To],”D”)+1)/7,1)*2)))

  24. Ann said,

    December 1, 2010 at 4:15 AM

    DateDifference in a simpler format that I pulled together after looking at the xPath for conditional formatting. This calculates the days remaining from the DueDate (a date column in a SharePoint list) and the current date.

    Note that the 1033 is the Locale ID for EN-US.

    ddwrt:DateTimeTick(ddwrt:FormatDate(ddwrt:GenDisplayName(string($thisNode/@DueDate)), 1033, 1)) – ddwrt:DateTimeTick(ddwrt:GenDisplayName(string($Today)))

  25. steve said,

    February 9, 2011 at 10:36 PM

    I have a sharepoint calculated column tracking months from a column that is dd/mm/year format. However, there are some items in the date column that are blank because the work hasn’t been completed yet. the formula automatically populates all blank entries as December so my data is inaccurate. anyone know of a formula so that blank entries won’t show up?

    thanks

    steve

  26. Il-ko said,

    March 13, 2011 at 3:34 PM

    hi great article, Thank you!

  27. music videos said,

    March 14, 2011 at 12:20 AM

    My developer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the expenses. But he’s tryiong none the less. I’ve been using Movable-type on several websites for about a year and am worried about switching to another platform. I have heard fantastic things about blogengine.net. Is there a way I can transfer all my wordpress posts into it? Any kind of help would be greatly appreciated!

  28. Hardaway said,

    March 26, 2011 at 1:08 AM

    Very good information! I should get a promotion after this one. Right now I’m not making enough money to buy anything. But your information means the world to me right now! THANKS

  29. Tipton said,

    June 2, 2011 at 2:03 AM

    I am currently working on a tracker for the trouble tickets that come thru our office and am looking for a formula to be able to set a suspence date. For example, the time we tell our users is 72 hour turn-around for all tickets that are opened. Once I create the new item i want the suspense date updated automatically. Any advice?

  30. Dave Schafer said,

    June 10, 2011 at 9:27 PM

    I created a simple formula to show me only the hours difference between two date / time columns. The formula TEXT(Created-[1stResponse],”h”) does return the hours but I can’t use the value returned to filter by unless it is converted to an Integer. Can this be done in the same formula?

  31. Ya Ya said,

    July 6, 2011 at 8:38 PM

    Hi great article, Thank you.

    Would you help me please?

    I want to calculate weekday from a column named “start date” with “dd/mm/yyyy” .

  32. Parker said,

    July 21, 2011 at 12:24 AM

    Does anyone know a formula to calulate previous month?

  33. ScottK said,

    July 21, 2011 at 3:09 AM

    Calculating Previous Month: I just finished up a project where I did just this by creating two “extra” columns for doing the calculation.

    **Create two columns
    FirstDayOfMonth =DATE(YEAR([DATEFIELD]),MONTH([DATEFIELD]),1)
    LastDayOfMonth =DATE(YEAR([DATEFIELD]),MONTH([DATEFIELD])+1,1)-1

    **Create the View
    Then created the view with the following filter:
    FirstDayofMonth –> is less than or equal to –> [TODAY]-30
    AND
    LastDayofMonth –> is greater than or equal to –> [TODAY]-30

    hope this works for you as well as it diid for me…

  34. Jordan Wright said,

    August 9, 2011 at 4:30 AM

    Question:
    Can someone tell me how to use the folder names as part of a calculation for a column?
    Ex. I have a folder structure that resides in a Records Center. The high level folder is “Credit” and the lower level folder is “Control System”. I would like to concatenate the two folder names to populate a column inside the “Control System” folder with “Credit – Control System”. Is that doable?
    Thanks!

  35. Nikki said,

    August 10, 2011 at 1:34 AM

    Thanks!! The hours difference between two dates/times was JUST what I was looking for. ❤

  36. ER said,

    August 17, 2011 at 4:50 AM

    Convert a month name, and year to last day of the month. The trick is to set the date to the first day on the next month, then subtract a day … you always get the last day of the month, even in leap years. It’s a thing of beauty. 😉

    =DATE(Year,(IF(Month=”January”,”01″,IF(Month=”February”,”02″,IF(Month=”March”,”03″,IF(Month=”April”,”04″,IF(Month=”May”,”05″,IF(Month=”June”,”06″,IF(Month=”July”,”07″,””)))))))&IF(Month=”August”,”08″,IF(Month=”September”,”09″,IF(Month=”October”,”10″,IF(Month=”November”,”11″,IF(Month=”December”,”12″,””))))))+1,1)-1

  37. Fredy said,

    September 23, 2011 at 10:48 PM

    =IF((ROUND((SIFECHA(DATEVALUE(YEAR([Fecha])&”/1/1″);[Fecha];”D”)/7)+0,285714285714285;0))=0;52;ROUND((SIFECHA(DATEVALUE(YEAR([Fecha])&”/1/1″);[Fecha];”D”)/7)+0,285714285714285;0))

  38. msbuzzz said,

    November 2, 2011 at 4:25 PM

    Hi Frndz,

    Our list will have a field called Created (date created ). Now how can I find out the age of that entry as of today in DAYS. I am not sure how can we use TOdays date, to minus with Created date.

    Since I am not storing Today’s date any ware!!

    Please help me! Thank you guys!!

  39. Dave Englund said,

    November 2, 2011 at 7:37 PM

    I have a field called “Start Date” that is based on the “Start Time” (=[Start Time]). But, in my list view the Start Date displays a date earlier than the Start Time date. Is there a tweak I can make to the calculated field to make sure it pulls the actual date of the Start Time?

  40. Jed Elliott said,

    November 3, 2011 at 4:59 AM

    Hi, I am trying to have a self defining ticket number. We are looking at getting Date created plus ID number. Does anyone know how to write the formula for this? For example we are looking at date created in the format of mm/dd/yy + ID field =mmddyyID.

  41. December 10, 2011 at 1:02 PM

    Hi there, You’ve performed a great job. I will certainly digg it and individually recommend to my friends. I’m confident they will be benefited from this site.

  42. paulstodart said,

    January 18, 2012 at 7:19 PM

    I am trying to calculate the number of days between a Date field and the edit of a Choice Field (Checkbox). For example : A date specifies when an activity should start, a checkbox to indicate the activity has started. Is there a formula possible that can work out the number of days between the specified date and the date the checkbox was “checked” (eg Modified – or set to a certain value.).

  43. February 13, 2012 at 2:10 PM

    Get Week of the year
    =DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time]))+0.5-WEEKDAY(DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])),2)+1

    i used that, but the result is wrong. please help me

  44. KK Stadler said,

    February 17, 2012 at 7:46 PM

    Fantastic quick reference. Mahalo.

  45. Tudor Iliescu said,

    February 23, 2012 at 9:16 PM

    Hi,

    I need to check that the input date is newer than a specific date in the past. I’ve tried with this formula: =[End date]>DATEVALUE(“2/10/2012”), but it didn’t do the job. Has anyone done something similar?
    pls help

  46. Vamsi said,

    March 12, 2012 at 10:18 AM

    how to search gridview datewise, gridview containing week startdate and enddate as data using linq, and date is sharepoint datetime control

  47. March 16, 2012 at 9:26 PM

    2012 is leap year so “Get Week of the year” is wrong.

  48. westerdaled said,

    March 23, 2012 at 11:09 PM

    Hi

    I am using these date calc fields

    Week Start
    =[Due Date]-WEEKDAY([Due Date],2)+1

    and Week End
    =[Due Date]+7-WEEKDAY([Due Date],2)

    However, When I want create a view that groups by either of these. The view is created. I attempt expand and SharePoint gives me an exception

    <hidden id=hidRootfolder …. attempted use an object that has ceased to exist

  49. bobet said,

    April 11, 2012 at 1:47 PM

    How can I make Friday as the first start of the week?

  50. bobet said,

    April 11, 2012 at 1:50 PM

    I also noticed that the weekly groupings on start on either a Sunday or a Monday. I need to start it on a Friday using weekday Formula.
    Pls HELP!

  51. May 6, 2012 at 6:38 PM

    Interesting…

    […]loads addiitional information for this types of area of interest on websites, observe[…]…

  52. Shop From Us said,

    July 18, 2012 at 4:50 AM

    You understand therefore considerably with regards to this topic, made me personally imagine it from so many numerous angles. Its like men and women are not fascinated until it is something to do with Lady gaga! Your own stuffs excellent. All the time care for it up!

  53. Me said,

    August 2, 2012 at 1:43 AM

    How can I get the second and fourth Thursday of each months within a year?

  54. Ritesh said,

    September 13, 2012 at 6:25 PM

    What’s the query to get the next four months?

  55. Athalis said,

    October 1, 2012 at 2:24 PM

    As you said, your example of “Last day of the month” does not handle Feb 29. This one does:

    =DATEVALUE(“01/”&(MONTH([Start Date])+1)&”/”&YEAR([Start Date]))-1

  56. jag said,

    October 18, 2012 at 4:16 PM

    Hi, This formula will calcualte dif between two dates, and even give a negative value. However if the orignal date is present and the actual date still needs to be filled in i want sharepoint to return “N/A” and not a massive number like -40,956.
    Any ideas?? Thankss 🙂

    =IF(ISERROR(DATEDIF([Original date],[Actual date],”d”)), -DATEDIF([Actual date],[Original date],”d”),DATEDIF([Original date],[Actual date],”d”))

  57. December 30, 2012 at 8:33 PM

    {
    {I have|I’ve} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It’s|It is} pretty worth enough for
    me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|websi

  58. xithi1 said,

    February 19, 2013 at 1:33 PM

    Nice post,thanks for sharing.:)
    wordpress developer

  59. April 3, 2013 at 12:04 PM

    This is a topic that’s close to my heart… Cheers!
    Where are your contact details though?

  60. April 8, 2013 at 8:31 PM

    W ofercie znajduje się montaż okien, zwykle okien PCV

  61. May 21, 2013 at 2:26 AM

    private aircraft private charter flight plane charter private jet charter private aircraft charters private aircraft charters

  62. August 24, 2013 at 10:05 AM

    Social media is a conduit through which society operates.
    Having a healthy experience of 3+ years, this company gives its solutions on Social media consulting,
    Social media marketing and Social media monitoring. A social network is a “grouping of individuals into specific groups.

  63. venky said,

    January 9, 2014 at 12:39 PM

    hi all,
    can we save dateTime up to milliseconds in a spList columns??

  64. Theo said,

    January 23, 2014 at 5:37 AM

    This unique blog post, “Common Date Time formulas
    for Sharepoint – Calculated Fields | Abstract Spaces”
    was excellent. I am making out a copy to
    show my personal friends. Thanks for your time-Madelaine

  65. Pooja said,

    January 31, 2014 at 4:28 PM

    We are looking at generating weekwise utilization reports for a 40 member team. We are able to get the week number with the help of formula shared above. Is there a way to get which week is that of the month. For example – week 5 is 27th Jan – 31st Jan 2014. Please help

  66. January 31, 2014 at 6:12 PM

    […] are a huge number of articles out there discussing how to create (semi-) dynamic list views or filters based […]

  67. June 14, 2014 at 1:19 AM

    I’ve been surfing online more than 3 hours today, yet I never found any interesting article
    like yours. It’s pretty worth enough for me. Personally,
    if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.

  68. hcg ez trim said,

    August 25, 2014 at 1:55 AM

    I think the admin of this website is truly working
    hard for his web page, for the reason that here every material is quality based data.

  69. Anne said,

    September 25, 2014 at 9:49 PM

    Can someone help me to get the second Wednesday of the month? Thank you so much

    • Larry Pfaff said,

      September 25, 2014 at 11:41 PM

      I can give you a few formulas that you can play with and figure out how to combined them later once you get it working. First I would get first day of month, either current or the month you need like from a due date or start date:
      =DATE(YEAR(DueDate),MONTH(DueDate),1)
      this will give you the fist day, easyu right? now get the weekday of this date:

      This formula comes close
      =IF(WEEKDAY(DATE(YEAR(DueDate),MONTH(DueDate),1))<4,DATE(YEAR(DueDate),MONTH(DueDate),1)+(4-WEEKDAY(DATE(YEAR(DueDate),MONTH(DueDate),1))),DATE(YEAR(DueDate),MONTH(DueDate),1)+11-WEEKDAY(DATE(YEAR(DueDate),MONTH(DueDate),1)))

      it doesn't account if the first day of month is a Wednesday. so do that check first

    • Larry Pfaff said,

      September 25, 2014 at 11:42 PM

      Forgot to add, this finds the first Wednesday. so you will add 7 to your final date for second wednesday

  70. Jay said,

    March 19, 2015 at 10:52 PM

    Is there a way to simply add 30 WORKING days to a date? I don’t need count the number of days between two dates, but I do need a date [30 working days hence] to automatically populate a calculated column field based on the manually entered date in another column.

    Scenario: A user enters a date in the “Report Date” column, and the “Reply Date” calculated column would automatically create a date which is the entered “Report Date” + 30 Working Days.

    The below formulas in the “Reply Date” calculated column add 30 calendar days, but they do not add 30 working days.

    =DATE(YEAR([Report Date]),MONTH([Report Date]),DAY([Report Date])+30)

    =[Report Date]+30

    I have observed multiple possible formulas in online forums, but the solutions offered for this type of problem seem to stop at a 7 to 14 day period (1-2 weeks) which is fairly easy to account for, but given that the number of days in a month vary, and they have a different number of weekends, it has been more difficult to find an attempt a 30 workday solution.

    Doubtless there is likely something obvious I have overlooked, but I haven’t yet identified what that is.

    I would be grateful for any assistance from the fine people who frequent this site.

  71. Jim said,

    October 11, 2015 at 9:38 AM

    Info sangat menarik, sukses ya mas.. , Adrianne

  72. November 18, 2015 at 8:54 AM

    Nice Post I really Like It thanks For sharing this. My friends also preparing on this for our purpose. welcome.

  73. November 18, 2015 at 12:18 PM

    Thanks for sharing article with us. I will be back whenever you will add new posts. Keep posting please. welcome

  74. RedOne said,

    March 4, 2016 at 2:54 AM

    Looking for a twist on this formula to include a work shift. Our folks work a typical shift of 12 hours. I am using a calendar (SharePoint) list form to have them enter only Start to End dates for workflow approvals, so only want one entry per block requested. For instance, they Start 3/1/2016 at 6 a.m. and End at 3/3/2016 at 6 p.m., they are requesting 36 vacation hours based on their shift schedule. I need to tweak the formula to use the 12-hr shift for the actual calculation. So far the =IF(NOT(ISBLANK([End Time])),([End Time]-[Start Time])*24,0) formula works well until they request >1 day. Playing with more to the IF statement, but no success so far. Any help is appreciated. Thx

  75. March 18, 2016 at 2:06 AM

    Do you mind if I quote a number of of your articles as long as I give credit score and sources back to your website? My blog is in the really exact same spot of curiosity as yours and my guests would surely benefit from some of the details you current here. Please allow me know if this okay with you. Cheers!

  76. Agen Ibcbet said,

    March 25, 2016 at 10:39 AM

    you are in reality a excellent webmaster. The site loading pace is amazing. It seems that you are doing any distinctive trick. Moreover, The contents are masterpiece. you’ve done a wonderful job on this topic!

  77. Amit said,

    May 18, 2016 at 2:25 AM

    amazing trick!

  78. Rick Naigle said,

    August 4, 2016 at 12:35 AM

    This website offers a formula for calculating the last day of the month – see above – with a caveat that the formula does not handle Feb 29.

    “Last day of the month for a given year (does not handle Feb 29). Result is in date format:”

    This formula handles Feb 29, and will return TBD when a date field is blank. The example uses the Created date field, but I usually use it with a Completed date field, or a Cancelled date field.

    =IF(Created=0,”TBD”,DATE(YEAR(Created),MONTH(Created)+1,1)-1)

    I have similar formulas to calculate the Fiscal Year and Quarter for a date – i.e., 17 Aug 2016 would return FY-Q = 16-4, and a formula which returns the Fiscal Year for a specific date – i.e., 22 Oct 2016 would return FY = 17.

  79. Tarandeep Singh said,

    September 3, 2016 at 11:34 PM

    Hello All,

    I would be grateful to you if you could help me to create a Formula for Below Criteria

    Working Days = Monday to Friday (Excluding Saturdays & Sundays)

    Working Hours= 10:30 AM to 7 PM

    SLA to Complete the Received Task in 4.15 Hours (4 Hours and 15 Minutes) and the working Hours should not get exceeded to 7 Pm.
    Else the left over time out of 4.15 (SLA) will get shifted to next Working Day.

    For Example; I have received a task on 1st September at 5:00 PM , However, My shift ends at 7:00 PM and my SLA to complete the Task is 4.15 WORKING HOURS. Hence I have just got 2 hours of today (7:00 PM – 5:00 PM= 2 Hours) and rest will get shifted to Next Working Day. Hence my DUE Time to complete the Task is 2nd September 12:45 PM.

    I would really appreciate your efforts and thanks a lot in advance.

    • jed elliott said,

      September 4, 2016 at 2:39 AM

      When you were talking in 30 minute increments it is always easier to use a workflow than a calculated field. You break it down into increments minutes and you count how many 10:30 a.m. is into the day and then how many you’re in time is from the end of the day in minutes. That will provide you a range that will make the workflow have the ability to move the time available and captured to the next day.

  80. dave star said,

    September 9, 2016 at 8:00 AM

    Wondering if anyone can help. Any advise appreciated!

    I’ve created a ‘Workers timesheet’ template in info path 2010 and uploaded to SharePoint 2013 library- it is designed to look like a table that asks users to enter in their work hours for each day in the labelled columns. Its Pretty straight forward. They use the browser in the SharePoint library to enter in their data then submit. One form for each Staff member in the library respectively. Easy.
    But, I need to set a field on the timesheet template to be a specific dynamic date, as it reads on the SP form “fortnight ending”. Explanation: Id like the fortnight ending field to fill in the fortnight date automatic so staff don’t have to look up what fortnight they are in. eg fortnight ending 20/9/16, then when the fortnight passes, the field changes to the next fortnight ending date eg, 4/10/16, then after that 18/10/16 etc…so it will change dynamically to exactly 14 days after the former date once that fortnight has passed.

    Any help is hugely welcome…happy to explain more

  81. ALIA AZIA said,

    September 13, 2016 at 2:27 PM

    HOW CAN I MAKE A CALCULATION FOR 1ST DAY OF THE NEXT MONTH FROM THE GIVEN DATE?

  82. Bobby said,

    May 4, 2017 at 12:45 AM

    I need to create a column that will show the day of the week using the date entered in another column (“Request Date” 5/3/2017)

  83. April 9, 2019 at 3:43 AM

    […] to Abstract Spaces for this information, and if you are like me that had some difficulties with calculating dates they have some wonderful information on this […]

  84. Marie said,

    March 19, 2021 at 9:31 PM

    A simple date fix not yet found – I want to remove the hrs, min, secs. from a calculated column equal to an actual date. Cannot find this anywhere. I use this to make the date field un-editable in a form.


Leave a reply to AbstractSpace Cancel reply