Solved

Trying to correct if then else statement in Excel 2007

Posted on 2012-03-30
4
232 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now