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
Please Login or Register to view this content.
Maybe a function
Please Login or Register to view this content.
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?Please Login or Register to view this content.
I get it working from 32 to 61.Originally Posted by oldchippy
But that doesn't help me figure out how it works...
DominicB
I still don't know how it works, but if you change the NOW() to 01/02/2007, your numbers throw up an incorrect answer - some months work below 32 or above 59, but all dates seem to work between 32 and 59.
We're waiting DADDY!
Yes, any number from 32 to 59 guarantees that it works.
=NOW()-DAY(NOW()) gives you some time on the last day of last month, If you then add any number between 32 and 59 you're guaranteed to be somewhere in next month.
Take 32 for instance, the formula
=DAY(NOW()-DAY(NOW())+32)
Will return 1 if current month has 31 days, 2 if current month has 30 days, 3 if current month has 29 days or 4 if current month has 28 days.
So deduct that number from 32 and you have the number of days in the current month
=32-DAY(NOW()-DAY(NOW())+32)
I like to suggest 42 because that number, of course, is the Answer to life, the universe and everything
Hitchhikers guide to the galaxy, quality DLL
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)
Hi daddylonglegs
Aaaaaaahhhhhh! Clever.Originally Posted by daddylonglegs
...but now you've just gone down in my estimation. Must try harder...Originally Posted by daddylonglegs
And why would you. Knew it was right up your street. Just thought I'd answer it wrong for a laughOriginally Posted by daddylonglegs
DominicB
That's another good one too for the file - thanks daddylonglegsPlease Login or Register to view this content.
I am attempting to count the Days in a month excluding holidays and weekends.
This formula "=NETWORKDAYS(EOMONTH(TODAY(),-1)+1,EOMONTH(TODAY(),0))" counts holidays as regular non week end days
Good evening cjtwhidbey
...and welcome to the forum!!
Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
DominicB
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks