Multiple If statement, else statement

iluvsafc

New Member
Joined
Jun 15, 2009
Messages
26
Hi Guys,

I'm usually OK with if statements but when it comes to multiple criteria i tend to get a bit confused.

Basically when a date is inputted that falls between the below date range i want the output in the next column to be the academic year.

Hope that makes sense guys!

Cheers,
Lee
Date range
Academic Year

<tbody>
</tbody>
01/08/2012
31/07/2013

<tbody>
</tbody>
2012/13

<tbody>
</tbody>
01/08/2013

<tbody>
</tbody>
31/07/2014

<tbody>
</tbody>
2013/14

<tbody>
</tbody>
01/08/2014

<tbody>
</tbody>
31/07/2015

<tbody>
</tbody>
2014/15

<tbody>
</tbody>
01/08/2015

<tbody>
</tbody>
31/07/2016

<tbody>
</tbody>
2015/16

<tbody>
</tbody>
01/08/2016

<tbody>
</tbody>
31/07/2017

<tbody>
</tbody>
2016/17

<tbody>
</tbody>

<tbody>
</tbody>






<tbody>
</tbody>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Assuming your inputted date is in Cell A1. In Cell B1 put:

=IF(MONTH(A1)>7,YEAR(A1) & "/" & YEAR(A1)+1,YEAR(A1)-1 & "/" & YEAR(A1))
 
Upvote 0
Sorry one more thing, can you stick an 'if blank' in there for me please with an output of "Provide start date"

Cheers!
 
Upvote 0
Sorry one more thing, can you stick an 'if blank' in there for me please with an output of "Provide start date"

Cheers!

This checks if the value is at least numeric. There is no built in function to check if the user has put a valid date but at least this is a little more than just checking for a blank cell

=IF(ISNUMBER(A1), IF(MONTH(A1)>7,YEAR(A1) & "/" & YEAR(A1)+1,YEAR(A1)-1 & "/" & YEAR(A1)),"Please Enter a Valid Date")
 
Upvote 0
If you are familiar with the code window you could insert your own function. If you go to the code window (Alt + [F11]) then go to the Project explorer (Ctrl + R) > Right Click the 'Microsoft Excel Objects' folder and choose Insert>Module.

In the module window paste:

Code:
Public Function IsDateValue(r As Range) As Boolean
    IsDateValue = IsDate(r)
End Function

Then you can use

=IF(IsDateValue(A1), IF(MONTH(A1)>7,YEAR(A1) & "/" & YEAR(A1)+1,YEAR(A1)-1 & "/" & YEAR(A1)),"Please Enter a Valid Date")

This will only accept a valid date
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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