# Troubleshooting Complex Nested If and If Functions

#### Stelchar

##### New Member
I'm having an issue with my nested if function. What I would ideally like to do is to compare 2 cells against a confidence interval percentage. So, if cell A is 5% higher than cell B I want my function to create a label the next cell as "Higher" and if its 10% higher than to be labeled as "Much Higher" and the same for 5% lower "Lower" and 10% lower "Much Lower" and if the values of both cells are the same the label to be "Same"
I have created a nested if function already....
=IF(D5<(C6*('Rating Legend'!\$B\$2*2)),"Much Lower",IF(D5<(C6-(C6*'Rating Legend'!\$B\$2)),"Lower",IF(D5>C6+(C6*'Rating Legend'!\$B\$2),"Higher",IF(D5>C6+(C6*('Rating Legend'!\$B\$2*2)),"Much Higher","Same"))))
*rating legend is on a separate worksheet where the confidence interval is located*
but can't seem to get the "much higher" portion to work properly. I have tried reversing the order but it still does not work properly...any feedback is welcome. Please!

#### AhoyNC

##### Well-known Member
You need to give Higher a range of values. Right now your formula will always return a True if D5>C6+(C6*Rating).
See the example below where I used the AND function to set a top and bottom range.
In this example If A1 is greater than B1+1 and less than or equal to B1+4 then HIGH. If greater than B1+4 then MUCH HIGHER.

There are two formulas shown below and you might be able to shorten your formula like the one in C2.

Excel Workbook
ABCD
11510
2
3
 Sheet3

1,081,703
Messages
5,360,747
Members
400,595
Latest member
T_Dubs

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...