Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi-
I have a spreadsheet with 1st column being numerical dates of the year. Second column contains initials of person on call for the corresponding date. Same person is on call for Friday, Saturday, and Sunday (weekend on call). I am unsuccessfully trying to write VB code to calculate how many weekends (not the total days) each person (by initials) is on call. (Spreadsheet has several yrs of dates, and people complaining that they have more weekends of call than someone else) TIA CLS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why use VBA.
Assuming dates in column A, people in column B =SUMPRODUCT((WEEKDAY(A1:A1000)=6)*(B1:B1000="Steve ")) counts how many Fridays Steve has worked, so how many weekends. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "bluestone" wrote in message om... Hi- I have a spreadsheet with 1st column being numerical dates of the year. Second column contains initials of person on call for the corresponding date. Same person is on call for Friday, Saturday, and Sunday (weekend on call). I am unsuccessfully trying to write VB code to calculate how many weekends (not the total days) each person (by initials) is on call. (Spreadsheet has several yrs of dates, and people complaining that they have more weekends of call than someone else) TIA CLS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just count the Fridays.
=sumproduct(-($B$1:$B$2000="initials"),-(Weekday($A$1:$A$2000,1)=6) You can replace "initials" with a cell that contains the person's initials so you can copy the formula down next to a list of initials. -- Regards, Tom Ogilvy "bluestone" wrote in message om... Hi- I have a spreadsheet with 1st column being numerical dates of the year. Second column contains initials of person on call for the corresponding date. Same person is on call for Friday, Saturday, and Sunday (weekend on call). I am unsuccessfully trying to write VB code to calculate how many weekends (not the total days) each person (by initials) is on call. (Spreadsheet has several yrs of dates, and people complaining that they have more weekends of call than someone else) TIA CLS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting dates but excluding weekends | Excel Worksheet Functions | |||
Exclude weekends when counting days only on day 29 or 30 | Excel Worksheet Functions | |||
Weekends | Excel Worksheet Functions | |||
Subtact 2 dates to get the number without counting weekends? | Excel Worksheet Functions | |||
How to Calculate Dates without counting the weekends | Excel Worksheet Functions |