?
Solved

Trying to correct if then else statement in Excel 2007

Posted on 2012-03-30
4
Medium Priority
?
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
OCDan earned 1200 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

771 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