+ Reply to Thread
Results 1 to 11 of 11

dates calculation in excel

Hybrid View

  1. #1
    Registered User
    Join Date
    05-25-2011
    Location
    dubai,uae
    MS-Off Ver
    Excel 2003
    Posts
    6

    Lightbulb dates calculation in excel

    Dear all
    I need your help here.

    how can i know the number of working days excluding fridays(friday is holiday).

    i have list of different dates in column A in column B i did only this to get total number of days

    =round(today()-A2,0) it gave me days diffence between today and selected date.

    in this days i want to exclude number of fridays fall in between.

    pls help.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: dates calculation in excel

    Chip as this array formula

    =SUM(IF(ISERROR(MATCH(WEEKDAY(ROW(INDIRECT(StartDate&":"&EndDate))),5,0)),1,0))

  3. #3
    Registered User
    Join Date
    05-25-2011
    Location
    dubai,uae
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: dates calculation in excel

    dear i just copied and pasted the same you posted and just i have entered real time values in the place of startdate, end date but i did not get the result it is showing only result as 1

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: dates calculation in excel

    Did you commit the formula with Ctrl+Shift+Enter?

  5. #5
    Registered User
    Join Date
    05-25-2011
    Location
    dubai,uae
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: dates calculation in excel

    sorry i didn't get you,
    other thing is i want to know the formula you posted, in that 5,0 mean?

    as far as I know 16 is the code for FRIDAY ONLY. pls correct me if i am wrong and pls asist.

  6. #6
    Registered User
    Join Date
    05-25-2011
    Location
    dubai,uae
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: dates calculation in excel

    dear kindly asist

  7. #7
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: dates calculation in excel

    Hello,

    Assume your date starts in A2 to down & you need to count the dates other than Friday between A2 & today()

    B2, copy down

    SUM(INT((WEEKDAY(A2-{1,2,3,4,5,7})+TODAY()-A2)/7))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  8. #8
    Registered User
    Join Date
    05-25-2011
    Location
    dubai,uae
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: dates calculation in excel

    Hi dear the above i tried but i got result as 5 digit numbers in all cells,

    any how thank you for you feedback.

    i got the answer with below formula
    =round(today()-A2+1-INT((WEEKDAY(A2-6)+today()-A2)/7),0)

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,698

    Re: dates calculation in excel

    Why are you using ROUND? If A2 is a date (with no time) then you don't need that function...

    Haseeb's solution should also work OK
    Audere est facere

  10. #10
    Registered User
    Join Date
    05-25-2011
    Location
    dubai,uae
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: dates calculation in excel

    its with time dear, since we pull out report daily basis which consisits of date with time.
    so i used round function.

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,698

    Re: dates calculation in excel

    OK but if A2 contains a time and date then I don't think your suggested formula works consistently, e.g. you can get different results even if the date is the same. For example if today is Sunday 5th June then if A2 contains Friday 3 June 2011 09:00 then the result is 2 but if you change the time to 13:00 the result is 1

    If you use this version

    =TODAY()-INT(A2)+1-INT((WEEKDAY(A2-6)+TODAY()-INT(A2))/7)

    Then you'll always get the same result for the same date, e.g. the above will always give 2 if the date is Friday 3 June

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1