|That is exactly what my suggestion does.|
All you did was reverse the logical_test and then swap the value_if_true and value_if_false.
You will note that with my suggestion, when E3 = 28, the logical_test will return FALSE since 28 is not less than 28. When the logical_test returns FALSE, the value_if_false is return by the IF function and the result will be 28.
While your solution definitely works, I'm only explaining how my suggestion works so that you get a deeper understanding of how the arguments for the IF function work.
Comparing my suggestion to yours and seeing why they both work should help you follow the logic of an IF function. Understanding how the value_if_true and value_if_false arguments work is required once you move on to a Nested IF, where one or both of those arguments might be another IF function.
For example, it appears that you want the maximum value of the function to be 28. Now let's add another requirement: the minimum value should be 10. Anything between 10 and 28 should return the value in E3. That would look like this:
You will note that for the logical_test E3>28, the value_if_false is another IF which "tests" to see if E3 is less than 10. If so, it returns 10, otherwise it returns the value in E3.
The main thing to keep in mind is that a Nested IF performs it's calculation from left to right and stops at the first logical_test that returns TRUE. In other words, it doesn't determine the result of every logical_test and then decide which result to use. It merely moves from left to right and as soon as it finds something that is TRUE, it returns the value_if_true for the preceeding logical_test. If none of the logical_tests are TRUE, then the entire IF returns the final value_if_false. For that reason, you must make sure that you put your logical_tests in the correct order so that it doesn't stop before it should.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.