SOLVED

#NAME? error from nested formula

%3CLINGO-SUB%20id%3D%22%5C%26quot%3Blingo-sub-3151168%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%23NAME%3F%20error%20from%20nested%20formula%26lt%3B%5C%2Flingo-sub%26gt%3B%3CLINGO-BODY%20id%3D%22%5C%26quot%3Blingo-body-3151168%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CP%3EI%20keep%20getting%20a%20%23NAME%3F%20error%20any%20time%20I%20input%20any%20number%20greater%20than%206%20in%20cell%20A1%20from%20the%20following%20nested%20IFAND%20formula.%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3E%3D%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EIF(AND(A1%26gt%3B0%2C%20A1%26lt%3B%3D3)%2C%20%225%22%2C%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EIF(AND(A1%26gt%3B3%2C%20A1%26lt%3B%3D6)%2C%20%2210%22%2C%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EIF(AND(A1%26gt%3B6%2C%20A1%26lt%3B%3D9)%2C%20%E2%80%9C15%E2%80%9D%2C%26lt%3B%5C%2FP%26gt%3B%3C%2FP%3E%3CP%3EIF(AND(A1%26gt%3B9%2C%20A1%26lt%3B%3D12)%2C%20%E2%80%9C20%E2%80%9D%2C0))))%3CBR%20%2F%3E%3CBR%20%2F%3EWhere%20is%20my%20mistake%3F%26nbsp%3B%26lt%3B%5C%2FP%26gt%3B%26lt%3B%5C%2Flingo-body%26gt%3B%3CLINGO-LABS%20id%3D%22%5C%26quot%3Blingo-labs-3151168%5C%26quot%3B%22%20slang%3D%22%5C%26quot%3Ben-US%5C%26quot%3B%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%26lt%3B%5C%2Flingo-label%26gt%3B%26lt%3B%5C%2Flingo-labs%26gt%3B%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3C%2FLINGO-SUB%3E
New Contributor

I keep getting a #NAME? error any time I input any number greater than 6 in cell A1 from the following nested IFAND formula. 

=

IF(AND(A1>0, A1<=3), "5",

IF(AND(A1>3, A1<=6), "10",

IF(AND(A1>6, A1<=9), “15”,

IF(AND(A1>9, A1<=12), “20”,0))))

Where is my mistake? 

7 Replies
best response confirmed by Carlin75 (New Contributor)
Solution

@Carlin75 

Your formula uses curly quotes instead of straight quotes around 15 and 20. Change them to straight quotes.

By the way, do you need the quotes at all? It appears to me that you want to return numbers, not text strings.

@Carlin75 

Most probably that's apostrophes around 15 and 20, change on "normal" ones

=IF(AND(A1>0, A1<=3), "5",
IF(AND(A1>3, A1<=6), "10",
IF(AND(A1>6, A1<=9), "15",
IF(AND(A1>9, A1<=12), "20",0))))
You are using the wrong double quotes around 15 and 20.
In fact you can get rid of all double quotes since you want a number for your output and not a text.

@Detlef Lewin 

<laugh>

(The forum appears to delete emojis)

@Carlin75 I changed from a nested IFAND formula to a IFS formula. Much easier. Thank you!

 

I typed the formula in word and tried to copy/paste into excel. Your comment made me realize the quotation marks are different. I ended up using an IFS formula instead.