Calculating months in year July - June

  • Thread starter Thread starter tuph
  • Start date Start date
T

tuph

This is probably a basic question, but how do use a date cell t
calculate how many months have gone by if my financial year runs fro
July to June and a sale was made in April (the result should be 10)?

Thanks in anticipation :confused
 
if months are in cells a1 and a2

=if(month(a2)<month(a1), 12 + month(a2)-month(a1), month(a2)-month(a1)
 
=DATEDIF(FY_Start,sale_date,"m")+1

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thanks, Bob, but I can't get your formula to work. I entered the
formula as:

=DATEDIF(1/7/2005,A10,"m")+1 (where the date in A10 = 1/10/2005)

and got the result of 1270, whereas the result I'm looking for is 4.

Should I have substituted something for "m"?

Trish
 
tuph said:
Thanks, Bob, but I can't get your formula to work. I entered the
formula as:

=DATEDIF(1/7/2005,A10,"m")+1 (where the date in A10 = 1/10/2005)

and got the result of 1270, whereas the result I'm looking for is 4.

Should I have substituted something for "m"?

Yes "ym", but you also need to get the starting date into tyhe right format;

=DATEDIF(DATE(2005,7,1),A10,"ym")+1
 
Yes "ym", but you also need to get the starting date into tyhe right
format;

=DATEDIF(DATE(2005,7,1),A10,"ym")+1

Too hurried reply again, I'm sorry. Actually the "m", rather than "ym" is
OK if the difference is less than a year. If there are years & months & you
need to sort out the extra months beyond the full years, that's where the
"ym" would be needed.
 
You have passed an invalid date, try

=DATEDIF(date(2005,7,1),A10,"m")+1

or

=DATEDIF(--"2005-07-01",A10,"m")+1

or better put it in a cell and reference that cell.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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

Back
Top