+ Reply to Thread
Results 1 to 3 of 3

Weekdayname function

  1. #1
    Forum Contributor
    Join Date
    05-13-2005
    Posts
    118

    Weekdayname function

    I have inserted teh days of a given month in my timesheet. Now I want to delete the weekend days from the list, and move the cells up. I basically have a loop that cycles down teh date entries and checks to see which days are Saturday or Sunday, then it deletes those dates.

    My only problem is calculating which days are weekends. I looked up the weekdayname function and its first parameter is a number (0-7) representing the day of the week. but my data is in the form: 12/1/07, 12/2/07, 12/3/07, etc. If i knew the number for the day of the week (e.g. Mon = 1, Tue = 2, etc) for my date I wouldn't need to check for weekend status since I'd know the day already, so I'm not sure if that's the function i want.

    I'm also familiar with the Day function which seems to be of no use since it returns an integer representing the day of hte month (1, 2, or 3 for my three dates above respectively).

    What function can i call to test if a date is a weekend in an If statement?

    GAry

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Are your dates actually dates ot text?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-13-2007
    Posts
    13
    You can use the the weekday function

    =IF(OR(WEEKDAY(B3,1) = 7,WEEKDAY(B3,1) = 7),"Weekend","Work Day")

    If the day of the week is 7 then it is saturday

    If the day of the week is 1 then it is Sunday

+ 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