[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Trying to correct if then else statement in Excel 2007

Posted on 2012-03-30
4
Medium Priority
?
241 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

650 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