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

x
?
Solved

how to write more than 7 IF statements within a formula

Posted on 2011-09-07
4
Medium Priority
?
174 Views
Last Modified: 2012-08-13
I got an error message when I reach August.  I heard the limitation is 7 IF statements within one formula.  Is there any other way I can include all 12 months in one formula?

IF(TRIM($C21)="January",1,IF(TRIM($C21)="February",2,IF(TRIM($C21)="March",3,IF(TRIM($C21)="April",4,IF(TRIM($C21)="May",5,IF(TRIM($C21)="June",6,IF(TRIM($C21)="July",7,0)))))))
0
Comment
Question by:jjxia2001
[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
  • 3
4 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 36498327
Use this formula:

=MATCH($C21,{"January","February","March","April","May","June","July","August","September","October","November","December"},0)

Kevin
0
 
LVL 81

Assisted Solution

by:zorvek (Kevin Jones)
zorvek (Kevin Jones) earned 1400 total points
ID: 36498337
Or this one:

=MONTH(VALUE("1 "&$C21))

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 36498341
You can't have more than seven nested functions which is what you are encountering with the IF function formula.

Kevin
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 600 total points
ID: 36498351
If you have just the month as text then this should do it

=MONTH(1&$C21)

regards, barry
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

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