date function

B

briank

how do I get a cell to show how many days will pass by the
end of the month. In other words, during the month of
September the cell will show 273, during October it will
show 304 and so on.

Thanks.
 
P

Peo Sjoblom

=TODAY()-"12/31/03"

or maybe

="09/30/03"-"12/31/02"

can also be written

=TODAY()-DATE(2002,12,31)
 
D

Daniel.M

Hi,

If current month,
NDays = DateSerial(Year(Date), Month(Date) + 1, 0) - DateSerial(Year(Date),
1, 0)


If you're picking month from a cell (A1 for example)
d = Range("A1")
NDays = DateSerial(Year(d), Month(d) + 1, 0) - DateSerial(Year(d), 1, 0)

Regards,

Daniel M.
 

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