Nested IF AND not working

%3CLINGO-SUB%20id%3D%22lingo-sub-3371670%22%20slang%3D%22en-US%22%3ENested%20IF%20AND%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3371670%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%20where%20have%20I%20gone%20wrong%20with%20this%26nbsp%3B%3DIF(AND(D339%3D0%2C%24Q%24337%3D0)%2CQ339%22%22%2CIF(AND(D339%3DVAT20_1%2C%24Q%24337)%2CQ339%22Y%22%2CIF(AND(D339%3DVAT20_3%2C%24Q%24337)%2CQ339%22Y%22%2C)))%20excel%20says%20it%20is%20not%20a%20formula.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3371670%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3371716%22%20slang%3D%22en-US%22%3ERe%3A%20Nested%20IF%20AND%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3371716%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1389653%22%20target%3D%22_blank%22%3E%40paul_fereday%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DIF(AND(D339%3D0%2C%24Q%24337%3D0)%2C%3CFONT%20color%3D%22%23DF0000%22%3EQ339%22%22%3C%2FFONT%3E%2CIF(AND(D339%3D%3CFONT%20color%3D%22%230000FF%22%3EVAT20_1%3C%2FFONT%3E%2C%24Q%24337)%2C%3CFONT%20color%3D%22%23DF0000%22%3EQ339%22Y%22%3C%2FFONT%3E%2CIF(AND(D339%3D%3CFONT%20color%3D%22%230000FF%22%3EVAT20_3%3C%2FFONT%3E%2C%24Q%24337)%2C%3CFONT%20color%3D%22%23DF0000%22%3EQ339%22Y%22%3C%2FFONT%3E%2C)))%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhat%20are%20you%20trying%20to%20return%20with%20the%20red%20parts%3F%20If%20you%20want%20to%20concatenate%26nbsp%3Bsomething%20with%20cell%20Q339%20you%20should%20use%20%3CFONT%20color%3D%22%23DF0000%22%3EQ339%26amp%3B%22Y%22%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAnd%20regarding%20the%20blue%20parts%2C%20are%20these%20named%20ranges%20or%20texts%3F%20If%20these%20are%20texts%20you%26nbsp%3B%3C%2FSPAN%3Eshould%20put%20quotations%20marks%20around%20them%2C%20like%20%3CFONT%20color%3D%22%230000FF%22%3E%22%3CSPAN%3EVAT20_1%22%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3371788%22%20slang%3D%22en-US%22%3ERe%3A%20Nested%20IF%20AND%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3371788%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20the%20blue%20parts%20are%20named%20ranges%20and%20the%20red%20ones%20are%20where%20i%20want%20my%20result%20either%20do%20nothing%20or%20the%20letter%20Y%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3371870%22%20slang%3D%22en-US%22%3ERe%3A%20Nested%20IF%20AND%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3371870%22%20slang%3D%22en-US%22%3EHi%20thanks%20for%20your%20input%20but%20i%20have%20just%20sorted%20it%20%3DIF(AND(D338%3D0%2C%24Q%24337%3D0)%2C%22%22%2CIF(AND(D338%3DVAT20_1%2C%24Q%24337%3D%22y%22)%2C%22Y%22%2CIF(AND(D338%3DVAT20_3%2C%24Q%24337%3D%22y%22)%2C%22Y%22%2C)))%3C%2FLINGO-BODY%3E
New Contributor

Hi all where have I gone wrong with this =IF(AND(D339=0,$Q$337=0),Q339"",IF(AND(D339=VAT20_1,$Q$337),Q339"Y",IF(AND(D339=VAT20_3,$Q$337),Q339"Y",))) excel says it is not a formula. 

3 Replies

@paul_fereday

=IF(AND(D339=0,$Q$337=0),Q339"",IF(AND(D339=VAT20_1,$Q$337),Q339"Y",IF(AND(D339=VAT20_3,$Q$337),Q339"Y",)))

 

What are you trying to return with the red parts? If you want to concatenate something with cell Q339 you should use Q339&"Y"

 

And regarding the blue parts, are these named ranges or texts? If these are texts you should put quotations marks around them, like "VAT20_1"

Hi the blue parts are named ranges and the red ones are where i want my result either do nothing or the letter Y@Riny_van_Eekelen 

Hi thanks for your input but i have just sorted it =IF(AND(D338=0,$Q$337=0),"",IF(AND(D338=VAT20_1,$Q$337="y"),"Y",IF(AND(D338=VAT20_3,$Q$337="y"),"Y",)))