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
Solved

What's wrong with this Excel IF function?

Posted on 2006-06-15
4
239 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
ID: 16915398
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
ID: 16915431
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
ID: 16915461
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
ID: 16915484
*replace mlsnader with fostejo. I confused the commenter with the questionner.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 104
detecting  the added row index in a datagridview 3 79
Path to Python 9 128
What are programming codes and how do they work? 7 103
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is about my first experience with programming Arduino.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

791 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