Hi All,
How do i count no of days in a month; excluding saturday & sunday.
regards,
Harish S
Hi All,
How do i count no of days in a month; excluding saturday & sunday.
regards,
Harish S
Good morning Harish S,
Take a look at this link on NETWORKDAYS, you will need to add-in the Analysis Tool Pak
http://www.exceltip.com/st/Calculati..._days/844.html
http://office.microsoft.com/en-gb/ex...277241033.aspx
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
Good morning harishs
Alternately, use this formula to return the number of days in the current month without the Analysis ToolPak add-in :
=DAY(DATE(YEAR(NOW()),MONTH(NOW())+1,0))
To return the number of days in a given month, replace the two "Now()" functions with a cell containing a valid date.
HTH
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Hi dominicb,
His question was how many weekdays - excluding weekends
How about
=NETWORKDAYS(DATE(YEAR(TODAY(),MONTH(TODAY(),1),DATE(YEAR(TODAY(),MONTH(TODAY()+1,0))
Maybe a function
Function WorkDaysInMonth(Month As Integer, Yr As Integer) Dim Holidays As Variant Holidays = Array("1/1/" & Yr, "25/12/" & Yr, "26/12/" & Yr) WorkDaysInMonth = networkdays( _ DateSerial(Year(Now), Month, 0), _ DateSerial(Year(Now), Month + 1, 0), Holidays) End Function
Put your holidays within the Array( ) statement. You'll need to
load the Analysis Tool Pack VBA add-in, and then in VBA go to the
Tools menu, choose References, and choose atvbaen.xls.
More information about working with holidays can be found at
www.cpearson.com/excel/holidays.htm
VBA Noob
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
If you're going to use ATP functions then you might as well use EOMONTH as well as NETWORKDAYS so for the number of workdays in the current month
=NETWORKDAYS(EOMONTH(TODAY(),-1)+1,EOMONTH(TODAY(),0))
or for any month if you have the first day of the month in A1
=NETWORKDAYS(A1,EOMONTH(A1,0))
...or without using Analysis ToolPak functions....
=SUM(INT((WEEKDAY(A1-{2,3,4,5,6})+DAY(A1+30-DAY(A1+31)))/7))
As oldchippy says, possibly not what the OP wants, but here's a way to get total days in the current monthOriginally Posted by dominicb
=42-DAY(NOW()-DAY(NOW())+42)
Good morning daddylonglegs
Just knew you'd jump into this thread somewhere
How the hell does that work!?!?!?!Originally Posted by daddylonglegs
DominicB
It is a good one this, it seems like any number between 32 and 59 calculates correctly - or am I wrong?=42-DAY(NOW()-DAY(NOW())+42)
I can never resist the lure of a juicy date [question]Originally Posted by dominicb
Further to the above. Using similar logic, if you have the 1st of a month in A1 this formula gives the number of days in the month
=50-DAY(A1+49)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks