IF Date issue

scottydogg84

New Member
Joined
Feb 22, 2011
Messages
12
I have a spreadsheet which includes thousands of invoices over the past 5 years, with info such as invoice number, date and amount.

What I need is a formula which will output "2006/07" IF the date (in column I) falls between 01/04/2006 and 31/03/2007, "2007/08" IF the date falls between 01/04/2007 and 31/03/2008, "2008/09" IF the date falls between 01/04/2008 and 31/03/2009, "2009/10" IF the date falls between 01/04/2009 and 31/03/2010 AND "2010/11" IF the date falls between 01/04/2010 and 31/03/2011.

I presume this would be some kind of long IF formula but I have a fairly basic knowledge of Excel so apologize in incorrect.

Thanking you advance.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Just to get you going, have you considered using a filter and select between dates? Then you could copy the results to another sheet, then repeat for each period.
 
Upvote 0
Yes but this doesn't really help me in what i want to achieve.

I want to return this data so i can then create a pivot table which will look like this:

Billings
Client 2006/07 2007/08 2008/09 2009/10 2010/11
Smith £80,000 £1,000 £500 0 0
Jones £85,000 £10,000 £600 £50 £6,000
Harold £60,000 £15,000 £5,000 £40 £10,000

If you could help with this formula i would be most grateful.
 
Upvote 0
This formula will work out the first years which will get you going.

Excel Workbook
IJ
1DateResult
201/05/20062006/07
312/12/2007 
401/03/20072006/07
530/10/2008 
614/09/2009 
712/01/2011 
Sheet1
 
Upvote 0
Cheers Trevor. Worked well.

Just out of interest for speed purposes, is there such a formula that could return any of the required data without me having to amend the formula for each year? Just have one formula that could be copied down the spreadsheet returning 2007/08 or 2008/09 etc without me having to change anything?

Sorry, i know i'm being lazy but would be handy to know as i could use this sort of formula for lot's of other things.

Thanks again.
 
Upvote 0
You are limited by the amount of IFs you can use. Here is some VBA code that may well help you. I have tested on the same amount of data I used with the Formula and it works quickly.

Sub FinYr()
With Range("i2", Range("i" & Rows.Count).End(xlUp)).Offset(, 1)
.NumberFormat = "General"
.Formula = "=RIGHT(YEAR(i2)-(MONTH(i2)<4),2)&""/""" _
& "&RIGHT(YEAR(i2)+(MONTH(i2)>3),2)"
.NumberFormat = "@"
.Value = .Value
End With
End Sub

Results show the following:

Excel Workbook
IJ
1DateResult
201/05/200606/07
312/12/200707/08
401/03/200706/07
530/10/200808/09
614/09/200909/10
712/01/201110/11
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,565
Messages
6,179,549
Members
452,927
Latest member
rows and columns

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top