Solved

Trying to correct if then else statement in Excel 2007

Posted on 2012-03-30
4
234 Views
Last Modified: 2012-04-02
Hello,
Would really appreciate assistance please.  


I am trying to correct the following formula in a spread sheet using Excel 2007:

=IF(AND(E2>$I$3,E2<=$J$3),”Spring 2011”,IF(AND(E2>=$I$4,E2<=$J$4),"Summer 2011",IF(AND(E2>=$I$5,E2<$J$5),"Fall 2011",IF(AND(E2>=$I$6,E2<=$J$6),"Spring 2012",IF(AND(E2>=$I$7,E2<=$J$7),"Summer 2012",IF(AND(E2>=$I$8,E2<=$J$8),"Fall  2012","From a Semester prior to 2011"))))))

the syntax checks out, but ai keep getting the last statement "From a Semester prior to 2011" in each and every cell.

I should not be getting:  "From a Semester prior to 2011"  at all.  all dates in column E are in 2011 or 2012.

My date column and column I and J have the same format of date
This is what I have set up in columns I and J:

row         I                        J    
3      01/01/2011      05/31/2011
4      06/01/2011      07/31/2011
5      08/01/2011      12/31/2011
6      01/01/2012      05/31/2012
7      06/01/2012      07/31/2012
8      08/01/2012      12/31/2012


Date data in E2 through E10

02/01/2011
04/19/2011
01/03/2011
02/28/2011
03/28/2011
04/18/2011
05/02/2011
05/16/2011
06/06/2011

The formula above, is written in column H which is blank, but the way the formula is written now, it prints:  "From a Semester prior to 2011.  Thank you for your assistance.
0
Comment
Question by:mtrout
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
OCDan earned 300 total points
ID: 37789306
Here you are mate file attached with working formula:
Semester.xlsx
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 37789541
Much simpler with a LOOKUP formula. Assuming no dates  are later than 2012 you can use the setup suggested by OCDan, with corrected years in column J then use this formula in G3 copied down

=IFERROR(LOOKUP(E3,H$3:J$8),"From a semester prior to 2011")

regards, barry
Date-LOOKUP.xlsx
0
 

Author Closing Comment

by:mtrout
ID: 37797186
Thank you Both OCDan and berryhoudinifor the responses. The one you corrected for me OCDan worked best for me and I can understand it.  Thank you both again.
0
 

Author Comment

by:mtrout
ID: 37797417
Question for you OCDan, Please.   I should have tested the formula in my spreadsheet before responding.  It did not work.   I checked the data type, seems like it's date to me. What else could be wrong?  Other than a column change, the formula seem the same.  What have I done incorrectly?  File (brief version) attached.  Thank you so much.  I can open a new call if that is needed, just let me know.
ExampleFileSemester.xls
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question