I have a spreadsheet with a date in column B on every row. I need to filter the data by "Trading year".
Year 1 runs from 1 Nov 2013 to 31 Oct 2014
Year 2 runs from 1 Nov 2014 to 31 Oct 2015
etc.
Can someone please suggest a simple formula so that I can add a "trading year" column that I can use to filter the data.
Formula for Trading year from date
-
- Administrator
- Posts: 12602
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
-
- Microsoft MVP
- Posts: 656
- Joined: 24 Jan 2010, 17:51
- Status: Microsoft MVP
- Location: Weert, The Netherlands
Re: Formula for Trading year from date
Something like:
Code: Select all
=YEAR(A1)-IF(MONTH(A1)<11,1,0)
-
- Administrator
- Posts: 12602
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- Administrator
- Posts: 12602
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Formula for Trading year from date
That works too Hans, but I found Jan Karel's formula easier to understand
StuartR
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Formula for Trading year from date
EDATE just calculates the amount of months before or after the given date...
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 12602
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Formula for Trading year from date
Rudi,
Yes, I looked at the help and realized how it works. Thank you.
Yes, I looked at the help and realized how it works. Thank you.
StuartR
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Formula for Trading year from date
The hardest part of EDATE is to work out what the "E" stands for?
It would have been more appropriate to name it MDATE (for month)!!
It would have been more appropriate to name it MDATE (for month)!!
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 12602
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Formula for Trading year from date
I ended up using EDATE as I needed to repeat it within the formula and it made everything a bit shorter. My final formula was
=IF(C3<>"",YEAR(EDATE(C3,-10)) & "-" & YEAR(EDATE(C3,2)),"")
Which produces
2013-2014
2014-2015
etc.
and leaves the cell blank on rows that haven't been completed yet
=IF(C3<>"",YEAR(EDATE(C3,-10)) & "-" & YEAR(EDATE(C3,2)),"")
Which produces
2013-2014
2014-2015
etc.
and leaves the cell blank on rows that haven't been completed yet
StuartR
-
- Administrator
- Posts: 78416
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Formula for Trading year from date
I think it stands for "Effective Date", as in "the effective date is 2 months from now".Rudi wrote:The hardest part of EDATE is to work out what the "E" stands for?
It would have been more appropriate to name it MDATE (for month)!!
An eDate, on the other hand, is something entirely different...
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 12602
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Formula for Trading year from date
Thank you to everyone for your help, and the enlightening asides. I have now replaced lots of SUMIF() formulae with SUMIFS() and my financial spreadsheet now correctly allows me to select a financial year and displays just the data for that year.
StuartR