I have "A, B, C and D." I need " if a>0, use a, otherwise, use b. If b has the error "#N/A", use c, otherwise use b. If c=0, use d/61, otherwise use c.

So far, I have this:


Where: DB11 = 0 (A), DA11 = #N/A (B), CZ11 = 138 (C) and BE11 = 6000 (D)

  • Maybe this article will help you better understand nesting.
    – Trav
    May 26, 2015 at 20:12

1 Answer 1


I think rewording your conditions may help you see where you've gone wrong. Think of it this way instead:

If `a>0`, then `a`. Otherwise, check if `b=#N/A`.
  If `b=#N/A`, then check if `c=0`. Otherwise, `b`.
    If `c=0`, then `d/61`. Otherwise, `c`.

Note the difference between the first line and what you described. You jumped straight to "use b" and then checked that b met a condition after you already said to use it. This won't work in a nested conditional statement. If you conclude something, then it's done; no other conditions are checked.

To illustrate this, consider the case where a=0, b=#N/A, c=0, and d=61. You expect this to result in 1. Evaluating your formula would go as follows:


Since the check of the condition on b concludes with c, the condition on c is never even checked. This is the source of your error.

Here's how your formula should be constructed.


To illustrate how this works, look at the same example case as above.

  • Just a comment: Very often, formulas that are too long/complex to wrap your head around can be simplified by breaking them up and putting intermediate results into additional columns. May 26, 2015 at 21:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .