Solved

What's wrong with this Excel IF function?

Posted on 2006-06-15
4
236 Views
Last Modified: 2010-04-17
=IF(E13<1001,E13*F5,IF(E13>1000<2001,E13*F6,IF(E13>2000<3001,E13*F7,IF(E13>3000<4001,E13*F8,IF(E13>4001,E13*F9))))) Is it possible to use greater than and less than multiple times in an IF function? Any help is appreciated.
0
Comment
Question by:mlsnader
  • 3
4 Comments
 
LVL 10

Assisted Solution

by:fostejo
fostejo earned 150 total points
Comment Utility
mlsnader,

To my knowledge, you can use constructs like 'E13>1000<2001' (which I presume means "Is E13 >1000 AND < 2001?")

Try using the AND keyword as per:

=IF(E13<1001,E13*F5,IF(AND(E13>1000,E13<2001),E13*F6,IF(AND(E13>2000,E13<3001),E13*F7,IF(AND(E13>3000,E13<4001),E13*F8,IF(E13>4001,E13*F9)))))

cheers
0
 
LVL 20

Accepted Solution

by:
alainbryden earned 350 total points
Comment Utility
You cannnot say something like E13>1000<2001

The correct way to do this type of thing is to write " E13>1000 AND E13<2001 "

That being said, you don't even need the greater than symbol in the second if statement, because if it has made it that far, then it is a given that E13 is creater than 1000, because you allready proved that it was not less than 1001. You are also missing the else statement for your final if. Your final if should be the else statement.

Therefore, here is the correct formula:

=IF(E13<1001,E13*F5,IF(E13<2001,E13*F6,IF(E13<3001,E13*F7,IF(E13<4001,E13*F8,E13*F9)))))
0
 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
As mlsnader submitted moments before, but as I said you do not need and statements at all, it's much more efficient without them, and mlsnader's formula is still missing the final else statement, for the last IF() bracket
0
 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
*replace mlsnader with fostejo. I confused the commenter with the questionner.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

10 Experts available now in Live!

Get 1:1 Help Now