+ Reply to Thread
Results 1 to 3 of 3

Using days of the week to calculate payment to part-time workers

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    Penticton, BC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Using days of the week to calculate payment to part-time workers

    I would like to convert a day of the week in cell (e.g. Saturday in cell G2), into it's numerical value in another cell (e.g. "7" in cell K2) so that I can use a formula:

    =SUM(INT((WEEKDAY(T2-DAY(T2)+1-R2)+(DAY(DATE(YEAR(T2),MONTH(T2)+1,0))-1))/7))

    to calculate how many of those weekdays (Saturdays in my example) there are in a specific calendar month. Is there a formula for this?

    Payroll.xlsx

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Using days of the week to calculate payment to part-time workers

    Hello
    Try the following in cell K2 down:

    =MATCH(TRIM(G2),{"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"},0)

    It's not elegant but I can't come up with anything else at the moment unless you use a Lookup Table. I've used the Trim function because some of your days in column G have spaces at the end. If not removed the Match function won't find a match.

    Hope this helps.

  3. #3
    Registered User
    Join Date
    12-06-2011
    Location
    Penticton, BC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Using days of the week to calculate payment to part-time workers

    Thanks DBY! That does do the trick.

    Sorry about the unnecessary spaces in the data entry for cell K2 - I should have double-checked that for consistency. After cleaning that up, I removed the TRIM function and voila, it works perfectly.

    Cheers.

+ 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