Count number of days in given month?

G

Guest

Anyone know how to get the count of the number of days (weekdays and
saturdays) in a given month.

For example, if I were to forecast revenue using the logic:
Average revenue per day is x
My store will be open for y days in month z

I would want the number of days (weekdays and saturdays) to calculate
automatically for any given month...

Thanks for your input!

Bryan
 
A

Arvi Laanemets

Hi

With any date from month searched for in cell A1
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0)
formatted as Number or General


Arvi Laanemets
 
D

Dave R.

You're welcome, you may try searching the google archive too in the future.
In my experience most excel questions have been asked (and answered) in this
newsgroup (worksheet.functions) even if they don't relate to functions. You
can navigate to this group in google groups and search only this group for
terms like "count sundays" and find similar things.
 
G

Guest

Anyway to add 1 month to the a specific date?

For example:

1/1/2005 + one month = first day in feb

1/31/2005 + one month = last day in feb
 
G

Guest

Nevermind, dumb question. I just subtract one day from the end date of the
following month.
 
D

Dave R.

Or you can use among other things =EDATE(A1,1)
Bryan said:
Nevermind, dumb question. I just subtract one day from the end date of the
following month.
 
M

Myrna Larson

The usual way is =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))

You can also check out the EOMONTH function in Help. If you decide to use it,
note what it says about the Analysis Tool Pack.
 
H

Harlan Grove

Myrna Larson wrote...
The usual way is =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))
....

?

If A1 were 31-Jan-2005, the formula above most definitely DOES NOT give
28-Feb-2005.

To return the corresponding day of the subsequent month, where, e.g.,
31-Jan would correspond to 28-Feb in non-leap-years, use

=A1+31-MOD(DAY(A1+31)-DAY(A1),DAY(A1+63-DAY(A1-DAY(A1)+63)))

or

=DATE(YEAR(A1),MONTH(A1)+1,MIN(DAY(A1),DAY(DATE(YEAR(A1),MONTH(A1)+2,0))))
 
M

Myrna Larson

I know it doesn't, but was responding to the part of the post I quote below,
not the question posed in the subject line. But of course that won't work
correctly for dates past the 28th.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top