Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - number of whole months between 2 days - but not starting on the 1st

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
GB
Hello

I'm working on some backdated payments for people. However, our pay month doesn't start until 16th of each month.

So I need to work out the number of whole pay periods (16th - 15th) between, say, 16/03/14 and 15/11/14 which should be 7.

I've got formulae all over the spreadsheet and would prefer to use a formula in this too.



thank you for helping

____________
Pendle
 
First calculate difference between full months. Next adjust days. If first date's day is less or equal to 16 and second date's day is greater or equal to 15 do nothing, otherwise deduct 1:
=12*(YEAR(Date2)-YEAR(Date1))+(MONTH(Date2)-MONTH(Date1))+IF(AND(DAY(Date1)<=16,DAY(Date2)>=15),0,-1)

combo
 
Thanks both - I shall try these tomorrow.

thank you for helping

____________
Pendle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top