date calculations
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Date Calculations

Date Calculations

resolvedResolved · Urgent Priority · Version 2007

replyReply Wed 14 Dec 2011, 16:53Delegate Natalie said...

Natalie has attended:
Excel Advanced course
Powerpoint Intermediate Advanced course

Date Calculations

It relates to dates calculations

Start Date End Date Daily rate Monthly rate
01/12/11 31/03/12 50.00 75.00
20/12/11 20/04/12 45.00 80.00

1. Is the Start Date a full month? if not return the number of days including the start date and mulitiply by Daily rate.
Example Start date 20/12/2011 means that (31days -19day = 12day * daily rate)

Example: start date= 01/12/2011 mean it is a full month and should be multiplied by monthly rate.


2 Is End date a full month? if not multiply number of days into month by daily rate.

End date 20/04/2012, this means 20 days * daliy rate rate.

For upcoming training course dates see: Pricing & availability

replyReply Fri 16 Dec 2011, 17:01Trainer Andrew said...

RE: Date Calculations

Hi Natalie

Thank you for your question. I have come up with a formula - it's rather long...

=IF(AND(A2=(DATE(YEAR(A2),MONTH(A2),1)),B2=(DATE(YEAR(B2),MONTH(B2)+1,0))),(B2-A2+1)*D2,(B2-A2+1)*C2)

where
A2 is the start date
B2 is the end date
C2 is the day rate
D2 is the month rate

To make it easier to test I have attached an example spreadsheet.

Would you be able to take a look and see if it produces the kind of thing you are looking for?

It used the date function and Excel's ability to work out day and month values with some logical functions If and And).


Kind regards,
Andrew

Attached files...

date calc example.xlsx

 

Please browse our web site to find out more about
vba excel course london and other Microsoft training courses.

Excel tip:

Return to the active cell after scrolling

When I scroll a long way down the screen from a selected cell, I can return to that cell with the Ctrl+Back Space shortcut. The active cell now appears in roughly the middle of the screen.

Shift+Back Space does something similar. Scroll down from the active cell and Shift+Back Space returns me to it and puts the active cell at the top of the screen; scroll up from the active cell and Shift+Back Space returns me to it and puts the active cell at the bottom of the screen.

Note also, that while Ctrl+Back Space will return me back to a selected range, Shift+Back Space only ever returns me to the active cell, which is normally at the top left-hand corner of any selected range.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard