Thread: Days formula
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Days formula

On Wed, 19 Sep 2007 09:12:00 -0700, Joe wrote:

Hi there. I would like to create a formula that calculates the days that the
invoice is outstanding. Now I have
=Today()
Date invoice plus 30 days
However, the 30 days should count after the end of the month of when the
invoice is raised. Any ideas? Thanks


I'm not sure I understand your question.

The days that the invoice is outstanding is:

=TODAY() - Invoice_Date

If you don't want to start counting days until after the last day of the month
in which the invoice was generated, then:

=TODAY()-EOMONTH(Invoice_Date,0)

or, if you don't have or want the Analysis Tool Pak installed:

=TODAY()-DATE(YEAR(Invoice_Date),MONTH(Invoice_Date)+1,0)

If you want to return a zero if TODAY() is before the end of the month, then:

=MAX(0,TODAY()-DATE(YEAR(Invoice_Date),MONTH(Invoice_Date)+1,0))

or

=MAX(0,TODAY()-EOMONTH(Invoice_Date,0))

--ron