does anyone have any idea how to in excel, return just the number of days in a month i.e. today is 3rd July, so we're in July, therefore return = 31 (as a number)?
Formulas: Dates
-
-
-
Set up a quick VLookup,
-
Place this formula in a cell on your worksheet
=EOMONTH(TODAY(),0)-EOMONTH(TODAY(),-1)
This will give the number of days in the current month
Replace TODAY() with a reference to another date for it to work for that date
For this function to work, you need the Analysis Toolpak VBA installed. Goto Tools Addins & check the relevant addin box.
Hope this helps.
-
Thanks!
-
I'm being daft now I'm sure , but I cant get it to work for other months when I change the TODAY().............
-
How about
=DAY(EOMONTH(TODAY(),0))
It sounds like the cell your are referencing is not a true date. See http://www.ozgrid.com/Excel/ExcelDateandTimes.htm
If you are typing the date directly into the formula, it should look like
=DAY(EOMONTH("1/2/03",0))
-
You are all stars!!! Thanks for your help!
-
Quote
Originally posted by Dave Hawley
How about=DAY(EOMONTH(TODAY(),0))
It sounds like the cell your are referencing is not a true date. See http://www.ozgrid.com/Excel/ExcelDateandTimes.htm
If you are typing the date directly into the formula, it should look like
=DAY(EOMONTH("1/2/03",0))
Hey :cool: even better...
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!