Daily Average

Y

yclhk

I prepare a report containing the daily average for every month in the year.
How can I set the formula (prefer not VBA) which can automatically identify
number of days for every month, i.e. in August, get the average of dividing
by 31; in September, get the average by dividing of 30 and so on ?
 
S

Stefi

Having year in A1, month No in B1:
=DAY(DATE(A1,B1+1,0))

Regards,
Stefi

„yclhk†ezt írta:
 
R

Ron@Buy

If A1 contains a date then =DAY(EOMONTH(A1,0)) will return the number of days
in that month.
Hope this helps
 
Y

yclhk

Thanks Ron & Stefi.

My MS office returns that the EMONTH function cannot be found. My MS office
is Office XP. Does the function not inclduding in this version.

The Date(year, month, day) formula is found worked. Pls be kind to explain
that :
- why the month value should add 1, i.e. B1+1
- does the value in B1 must be alphabet

Thanks a lot,
 
S

Stefi

If you have Jan,Feb, etc. in column B, then you can use (in UK date system)
=DAY(DATE($A$1,MONTH(DATEVALUE("1/"&B1&"/"&$A$1))+1,0))
or (in US date system)

=DAY(DATE($A$1,MONTH(DATEVALUE(B1&"/1/"&$A$1))+1,0))

For EOMONTH you have to enable Analisys Toolpak.

DATE(year,month+1,0) is a workaround: 0th day of a month equals last day of
the previous month by Excel calculation method.

Regards,
Stefi


„yclhk†ezt írta:
 
D

David Biddulph

And what did it say when you typed EOMONTH into Excel help, as I suggested?
 

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