Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Nested IF/then statements

0

I can do basic formulas in excel. I am in the process of building a spreadsheet to help track our maintenance due on our equipment. 

this is the formula I have

=IF((H17-I17)>="200","pm1","0")=IF((H17-I17)>="450","pm2","0")=IF((H17-I17)>="950","pm3","0")=IF((H17-I17)>"1950","pm4","0")

when i hit enter it comes back as false. Am not sure what I did wrong.

Any help with this would be greatly appreciated

                                                             Thank you

                                                                  Wanda

Answer
Discuss

Answers

0
Selected Answer

You havent actually nested the IF functions.

Im on mobile now so i cant test one for you but here is our tutorial on nesting if functions. Check that out and it should explain everything.

Update

(back on my computer now)

Your formula is not nested correctly but also will fail to return the correct numbers since you don't check if the number is within a range. You check if it is greater than 200 and then greater than 450 etc, but if the number is 2000, it will return true for every IF statement that is checked against it. As such, I added some AND functions to check for a range and nested the IF statements.

=IF(AND((H17-I17)>="200",(H17-I17)<450),"pm1",IF(AND((H17-I17)>="450",(H17-I17)<950),"pm2",IF(AND((H17-I17)>="950",(H17-I17)<1950),"pm3",IF((H17-I17)>"1950","pm4","0"))))

In reality though, you should be using a VLOOKUP function for a range of numbers for this.

Discuss

Discussion

The numbers being between double quotes are text...
pecoflyer Jan 8, '17 at 8:10 am
I just took the formula that they provided and went with it since that seemed to be the least of the issues to begin with.
don (rep: 1989) Jan 10, '17 at 12:24 pm
Thank you for the help I know see what I needed to do.
wanda (rep: 2) Jan 11, '17 at 4:17 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login