DATES compaison (1 Viewer)

cocoonfx

cocoonfx
Local time
Today, 12:20
Joined
Oct 13, 2005
Messages
62
Hello

I have to work out how much money we owe a supplier. I have a report which in cell E2 i have a the start date. We then get 22 days free in which i have create a cell J2 I then want to find out from the end of the free days to the current day how many days have past and then i want to mutliply the number of days by a price to give me a total i.e:

Start Date Date Free Days Expire Cost Per Day No Days Total
31/10/2005 22/11/2005 £30 50 £1500


So in the cell number of days i have =(DATE(YEAR(E2),MONTH(E2),DAY(E2)+22))

Then in the total column i have =sum(now()-"No Days)*£30

The sum then returns £1515 which is wrong

Could anyone advise a formula on how to do this more efficent and correctly?
 

Mile-O

Back once again...
Local time
Today, 12:20
Joined
Dec 10, 2002
Messages
11,316
All days, or working days only?
 

Brianwarnock

Retired
Local time
Today, 12:20
Joined
Jun 2, 2003
Messages
12,701
If you are happy to use the function Datedif which is supported by EXCEL but has not been in help since release 2000 then

=(DATEDIF(E2,TODAY(),"D")-22)*30

Gives you the answer in one go


Brian
 

Brianwarnock

Retired
Local time
Today, 12:20
Joined
Jun 2, 2003
Messages
12,701
Here is the help on Datedif from EXCEL 2000

DATEDIF
See also

Calculates the number of days, months, or years between two dates. This function is provided for compatibility with Lotus 1-2-3.

Syntax

DATEDIF(start_date,end_date,unit)

Start_date is a date that represents the first, or starting, date of the period. Dates may be entered as text strings within quotation marks (for example, "2001/1/30"), as serial numbers (for example, 36921, which represents January 30, 2001, if you're using the 1900 date system), or as the results of other formulas or functions (for example, DATEVALUE("2001/1/30")). For more information about date serial numbers, see NOW.

End_date is a date that represents the last, or ending, date of the period.

Unit is the type of information you want returned.

Unit Returns
"Y" The number of complete years in the period.
"M" The number of complete months in the period.
"D" The number of days in the period.
"MD" The difference between the days in start_date and end_date. The months and years of the dates are ignored.
"YM" The difference between the months in start_date and end_date. The days and years of the dates are ignored.
"YD" The difference between the days of start_date and end_date. The years of the dates are ignored.


Remarks

Microsoft Excel stores dates as sequential serial numbers so that it can perform calculations on them. Excel stores January 1, 1900, as serial number 1 if your workbook uses the 1900 date system. If your workbook uses the 1904 date system, Excel stores January 1, 1904, as serial number 0 (January 2, 1904, is serial number 1). For example, in the 1900 date system, Excel stores January 1, 1998, as serial number 35796 because it is 35,795 days after January 1, 1900. Learn more about how Microsoft Excel stores dates and times.


Brian
 

Users who are viewing this thread

Top Bottom