+ Reply to Thread
Results 1 to 8 of 8

Change WEEKDAY, NETWORKDAYS functions for other cultures

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2003
    Posts
    29

    Change WEEKDAY, NETWORKDAYS functions for other cultures

    Here in Dubai, the NETWORKDAYS function does not work properly because our workweek runs from Sunday-Thursday. Is there a way to modify the function to understand a different kind of calendar?

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    Hi,

    Does this work for you?

    =SUMPRODUCT(--(TEXT(ROW(INDIRECT(A1&":"&B1)),"dddd")<>"Friday"),--(TEXT(ROW(INDIRECT(A1&":"&B1)),"dddd")<>"Saturday"))

    A1 being the start date and B1 the end date
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    FYI: I have moved this thread from Non-English forum to Worksheet Functions Forum (the former being for question written in other languages)

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    Quote Originally Posted by DonkeyOte View Post
    FYI: I have moved this thread from Non-English forum to Worksheet Functions Forum (the former being for question written in other languages)
    Probably the best place for it - thanks

  5. #5
    Registered User
    Join Date
    06-09-2009
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    Old Chippy - Thanks a lot, that actually does serve the purpose of NETWORKDAYS and gives me an accurate calculation. Brilliant! And it certainly solves my immediate task. It's also flexible enough for me to tweak in a variety of ways. Going to be very useful.

    Perhaps I had not been clear, about one thing, however. Since this will certainly not be the last time I'll have to use various day-of-the-week functions that will be thrown off by our calendar here, is anyone aware of a more general solution, either with VBA or perhaps a setting somewhere, that will get Excel to treat different days as week days if I so choose?

    Thanks in advance....

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

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    Hi,

    does this link help?

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    also, a search on this board of NETWORKDAYS alternatives with daddylonglegs as poster is bound to throw up a variety of examples.

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

    Re: Change WEEKDAY, NETWORKDAYS functions for other cultures

    I'm not aware of any general setting you can change.....

    If your work week is still 5 consecutive days then you can easily modify NETWORKDAYS, e.g. for Sunday to Thursday

    =NETWORKDAYS(A1+1,B1+1)

    [If you want Saturday to Wednesday its +2, +3 for Friday to Tuesday etc.]

    If you want to exclude holidays too then the formula needs to be "array entered"

    =NETWORKDAYS(A1+1,B1+1,H$1:H$10+1)

    confirmed with CTRL+SHIFT+ENTER

    where H1:H10 contain holiday dates

    You can also use a formula like this to count Sunday to Thursday

    =SUM(INT((WEEKDAY(A1-{1,2,3,4,5})+B1-A1)/7))

    {1,2,3,4,5} defines the days to count (1= Sun through to 7 = Sat) so you can modify in any way you want to count any combination of days, e.g. Monday and Thursday only....

    =SUM(INT((WEEKDAY(A1-{2,5})+B1-A1)/7))

    but this approach is less adaptable should you wish to exclude holidays also

+ 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