SOLVED

IF formula implementation with multiple logic

%3CLINGO-SUB%20id%3D%22lingo-sub-1270145%22%20slang%3D%22en-US%22%3EIF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1270145%22%20slang%3D%22en-US%22%3E%3CP%3ETable%20data%3A%3C%2FP%3E%3CP%3EA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20B%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20C%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BD%3C%2FP%3E%3CTABLE%20border%3D%220%22%20cellspacing%3D%220%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2286%22%20height%3D%2217%22%3ECOUNT%3C%2FTD%3E%3CTD%20width%3D%2286%22%3ECOM-RESULT%3C%2FTD%3E%3CTD%20width%3D%2286%22%3ELOOK-VAL1%3C%2FTD%3E%3CTD%20width%3D%2286%22%3ELKVALUE-2%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3ECEM%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3ENONCAT%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3EINFORMATION%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3EFINANCE%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3ECR%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3EPENSION%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3EUINV%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3ECTRLM%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3EJIPE%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2217%22%3E1%3C%2FTD%3E%3CTD%3EFALSE%3C%2FTD%3E%3CTD%3ECSARC%3C%2FTD%3E%3CTD%3E--%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20condition%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20COUNT%3D1%20and%20COM-RESULT%20%3DFALSE%20and%20LKVALUE-2%20%3D%20--%20and%20LOOK-VAL1%20contains%20%22CEM%22%20or%20%22NONCAT%22%20or%20%22INFORMATION%22%20or%20%22FINANCE%22%20or%20%22CR%22%20or%20%22PENSION%22%20or%20%22UINV%22%20or%20%22CTRLM%22%20or%20%22JIPE%22or%20%22CSARC%22%20then%20my%20output%20is%20%22Required%20action%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFormula%20so%20far%20tried%3A%3C%2FP%3E%3CP%3E1)%20%3DIF(OR(AND(C2%3D%22CEM%22%2C%20A2%3D1%2C%20B2%3D%22FALSE%22%2C%20D2%3D%22--%22)%2C%20AND(C2%3D%22NONCAT%22%2C%20A2%3D1%2C%20B2%3D%22FALSE%22%2C%20D2%3D%22--%22))%2C%20%22Required%20action%22%2C%20%22NA%22)--%26gt%3B%20Here%20implemented%20for%20first%20two%20values%20for%20LOOK-VAL1%20column%20(CEM%20%26amp%3B%20NONCAT)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EResult%20of%20above%20formula%20working%20correctly%20for%20first%20row%20value%20(i.e-if%20C2%3D%20%22CEM%22)%20but%20not%20for%20second%20row%20value(NONCAT)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2)%3DIF(OR(C2%3D%22CEM%22%2C%20C2%3D%22NONCAT%22%2C%20C2%3D%22INFORMATION%22%20%2C%20C2%3D%22FINANCE%22%20%2C%20C2%3D%22CR%22%20%2C%20C2%3D%22PENSION%22%20%2C%20C2%3D%20%22UINV%22%20%2C%20C2%3D%22CTRLM%22%20%2C%20C2%3D%22JIPE%22%20%2C%20C2%3D%22CSARC%22)%2C%20%22Required%20action%22%2C%20%22NA%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EResult%20of%20above%20formula%20is%20only%20comparing%20the%20C%20column%20values%20but%20i%20couldn't%20able%20to%20add%20conditions%20related%20to%20column%20A%20%2C%20B%20and%20D.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKindly%20let%20me%20know%20any%20possible%20solution%20for%20the%20above%20problem%20statement.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1270145%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-1270465%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1270465%22%20slang%3D%22en-US%22%3EHi%20Nandhu19940%3CBR%20%2F%3E%3CBR%20%2F%3ETry%20plugging%20this%20in%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3DIF(AND(IF(AND(A2%3D1%2CB2%3DFALSE%2CD2%3D%22--%22)%2C%22AN%22%2C%22-%22)%3D%22AN%22%2CIF(OR(C2%3D%22CEM%22%2CC2%3D%22NONCAT%22%2CC2%3D%22INFORMATION%22%2CC2%3D%22FINANCE%22%2CC2%3D%22CR%22%2CC2%3D%22PENSION%22%2CC2%3D%22UINV%22%2CC2%3D%22CTRLM%22%2CC2%3D%22JIPE%22%2CC2%3D%22CSARC%22)%2C%22AN%22%2C%22-%22)%3D%22AN%22)%2C%22AN%22%2C%22-%22)%3CBR%20%2F%3E%3CBR%20%2F%3EJust%20replace%20%22AN%22%20with%20%22Required%20action%22%3CBR%20%2F%3EBR%2C%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1270880%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1270880%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F531305%22%20target%3D%22_blank%22%3E%40Branislav1984%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDear%20Bran%2C%3C%2FP%3E%3CP%3EYour%20formula%20works%20perfectly%20and%20kindly%20explain%20me%20the%20concept%20behind%20that%20one.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1271539%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1271539%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F585099%22%20target%3D%22_blank%22%3E%40Nandhu19940%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20basically%20did%20two%20tests%20and%20merged%20them%20into%20one....so%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DIF(AND(A2%3D1%2CB2%3DFALSE%2CD2%3D%22--%22)%2C%22AN%22%2C%22-%22)...lets%20call%20this%20TestA%2C%20which%20will%20either%20return%20AN%20or%20fail%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DIF(OR(C2%3D%22CEM%22%2CC2%3D%22NONCAT%22%2CC2%3D%22INFORMATION%22%2CC2%3D%22FINANCE%22%2CC2%3D%22CR%22%2CC2%3D%22PENSION%22%2CC2%3D%22UINV%22%2CC2%3D%22CTRLM%22%2CC2%3D%22JIPE%22%2CC2%3D%22CSARC%22)%2C%22AN%22%2C%22-%22)....lets%20call%20this%20TestB%20whcih%20will%20again%20either%20return%20AN%20or%20fail...%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EFinally%20you%20combine%20them%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DIF(AND(TestA%20%3D%22AN%22%2C%20TestB%3D%22AN%22)%2C%20%22AN%22%2C%20%22-%22)...meaning%20both%20separate%20test%20must%20return%20AN%20in%20order%20for%20formula%20to%20evaluate.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EHopefully%20its%20a%20bit%20clearer...I%20got%20lost%20myself%20trying%20to%20dissect%26nbsp%3Bit%20and%20I%20wrote%20it%20like%202%20hours%20ago%20%3CLI-EMOJI%20id%3D%22lia_grinning-face-with-smiling-eyes%22%20title%3D%22%3Agrinning_face_with_smiling_eyes%3A%22%3E%3C%2FLI-EMOJI%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ESoon%2C%20we%20will%20have%20access%20to%20new%20function%20%22LET%22%20which%20will%20help%20with%20writing%20formulas%20like%20this.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EBest%20regards%2C%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1301057%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1301057%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F531305%22%20target%3D%22_blank%22%3E%40Branislav1984%3C%2FA%3E%26nbsp%3BThanks%20lot%20for%20explaining%20me%20the%20concept%20and%20now%20i%20could%20do%20more%20better%20in%20IF%20conditions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELets%20wait%20for%20LET%20function%20to%20come%20in%20future.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1301139%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1301139%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F585099%22%20target%3D%22_blank%22%3E%40Nandhu19940%3C%2FA%3E%26nbsp%3BNot%20that%20it%20matters%20much%20but%20just%20to%20demonstrate%20another%2C%20more%20dynamic%2C%20approach%20that%20does%20not%20require%20you%20to%20%22hard-code%22%20all%20the%20keywords%20into%20many%20nested%20IF%20statements.%20Create%20a%20list%20with%20keywords%20and%20give%20it%20a%20name.%26nbsp%3BThen%20this%20will%20work%20as%20well%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIFERROR(IF(AND(%24A%242%3A%24A%2411%3D1%2C%24B%242%3A%24B%2411%3DFALSE%2C%24D%242%3A%24D%2411%3D%22--%22%2CMATCH(C2%2Ckeywords%2C0))%2C%22Required%20Action%22)%2C%22x%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIt's%20demonstrated%20in%20the%20attached%20workbook.%20Adopt%20the%20ranges%20to%20your%20real%20situation%2C%20give%20them%20names%20or%20use%20structured%20table%20references%20to%20make%20it%20really%20dynamic.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1301928%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1301928%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F585099%22%20target%3D%22_blank%22%3E%40Nandhu19940%3C%2FA%3E%26nbsp%3BSorry%2C%20but%20I%20don't%20know%20enough%20about%20the%20technology%20%22behind%22%20all%20of%20it%20to%20understand%20what%20to%20do%20or%20not%20to%20do%20to%20boost%20performance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1301900%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1301900%22%20slang%3D%22en-US%22%3E%3CP%3E%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%3BSuch%20a%20wonderful%20way%20of%20minimizing%20the%20lengthy%20formula%20thanks%20lot%20Riny.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3EQueries%3A%3C%2FP%3E%3CP%3E1)%20Here%20in%20my%20count%2C%20com-result%20column%20values%20will%20differ%20and%20moreover%20rows%20can't%20be%20fixed%20in%20this%20section.%3C%2FP%3E%3CP%3E2)%20Dynamic%20rows%20will%20be%20there%20and%20need%20to%20implement%20formula%20accordingly%20so%20i%20tried%20below%20thing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFormula%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIFERROR(IF(AND(A2%3D%24H%242%2CB2%3D%24H%243%2CD2%3D%24H%244%2C%20MATCH(C2%2Ckeywords%2C0))%2C%22Required%20Action%22)%2C%22x%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBecause%20in%20your%20formula%20design%20i%20could%20see%20three%20column%20rows%20range%20is%20fixed%20but%20that%20won't%20workout%20for%20me%20and%20moreover%20my%20result%20for%20above%20formula%20is%20quite%20different%20because%20of%20using%20IFERROR%20it%20throws%20me%20FALSE%20when%20we%20not%20get%20match%20for%20A2%2C%20B2%20%26amp%3B%20D2%20column%20values%20with%20fixed%20one.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPerformance%20issue%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnother%20on%20thing%20here%20is%20my%20workbook%20has%20many%20rows%20(100000%20%2B%20rows)%20data%2C%20so%20when%20i'm%20implementing%20the%20formula%20it's%20very%20slow%20and%20taking%20more%20time%20to%20implement%20for%20all%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20need%20to%20give%20work%20around%20on%20performance%20as%20well%20and%20let%20me%20know%20any%20tips%20you%20can%20avail%20for%20performance%20improvement%20in%20macro%20running.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIssue%3A%3C%2FP%3E%3CP%3ECalculating%202%20processors%20(2%25)%2C%20i'm%20getting%20this%20one%20while%20running%26nbsp%3B%20my%20macro%20and%20taking%20too%20long%20time%20to%20finish%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1302020%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20formula%20implementation%20with%20multiple%20logic%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1302020%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F585099%22%20target%3D%22_blank%22%3E%40Nandhu19940%3C%2FA%3E%26nbsp%3BBased%20on%20your%20altered%20question%2C%20I%20have%20inserted%20your%20formula%20in%20my%20original%20sheet%20(attached)%20and%20it%20seems%20to%20work%20as%20intended.%20IF%20all%20four%20conditions%20are%20met%20(1%2C%20FALSE%2C%20--%20and%20found%20in%20the%20list%20of%20keywords)%2C%20THEN%20the%20required%20action%20will%20take%20place%20ELSE%20something%20else.%20That's%20exactly%20the%20point%20of%20the%20IFERROR%20statement.%20You%20still%20need%20to%20specify%20what%20needs%20to%20be%20done%20when%20the%20outcome%20of%20these%20four%20tests%20is%20FALSE.%26nbsp%3BBut%20perhaps%20I%20don't%20really%20understand%20the%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Table data:

A                  B                  C                         D

COUNTCOM-RESULTLOOK-VAL1LKVALUE-2
1FALSECEM--
1FALSENONCAT--
1FALSEINFORMATION--
1FALSEFINANCE--
1FALSECR--
1FALSEPENSION--
1FALSEUINV--
1FALSECTRLM--
1FALSEJIPE--
1FALSECSARC--

 

My condition:

 

If COUNT=1 and COM-RESULT =FALSE and LKVALUE-2 = -- and LOOK-VAL1 contains "CEM" or "NONCAT" or "INFORMATION" or "FINANCE" or "CR" or "PENSION" or "UINV" or "CTRLM" or "JIPE"or "CSARC" then my output is "Required action".

 

Formula so far tried:

1) =IF(OR(AND(C2="CEM", A2=1, B2="FALSE", D2="--"), AND(C2="NONCAT", A2=1, B2="FALSE", D2="--")), "Required action", "NA")--> Here implemented for first two values for LOOK-VAL1 column (CEM & NONCAT)

 

Result of above formula working correctly for first row value (i.e-if C2= "CEM") but not for second row value(NONCAT)

 

2)=IF(OR(C2="CEM", C2="NONCAT", C2="INFORMATION" , C2="FINANCE" , C2="CR" , C2="PENSION" , C2= "UINV" , C2="CTRLM" , C2="JIPE" , C2="CSARC"), "Required action", "NA")

 

Result of above formula is only comparing the C column values but i couldn't able to add conditions related to column A , B and D.

 

Kindly let me know any possible solution for the above problem statement.

8 Replies
Highlighted
Best Response confirmed by Nandhu19940 (Occasional Contributor)
Solution
Hi Nandhu19940

Try plugging this in:

=IF(AND(IF(AND(A2=1,B2=FALSE,D2="--"),"AN","-")="AN",IF(OR(C2="CEM",C2="NONCAT",C2="INFORMATION",C2="FINANCE",C2="CR",C2="PENSION",C2="UINV",C2="CTRLM",C2="JIPE",C2="CSARC"),"AN","-")="AN"),"AN","-")

Just replace "AN" with "Required action"
BR,
Highlighted

@Branislav1984 

Dear Bran,

Your formula works perfectly and kindly explain me the concept behind that one.

 

Highlighted

Hi @Nandhu19940 

 

I basically did two tests and merged them into one....so,

 

=IF(AND(A2=1,B2=FALSE,D2="--"),"AN","-")...lets call this TestA, which will either return AN or fail

 

=IF(OR(C2="CEM",C2="NONCAT",C2="INFORMATION",C2="FINANCE",C2="CR",C2="PENSION",C2="UINV",C2="CTRLM",C2="JIPE",C2="CSARC"),"AN","-")....lets call this TestB whcih will again either return AN or fail...

 

Finally you combine them:

=IF(AND(TestA ="AN", TestB="AN"), "AN", "-")...meaning both separate test must return AN in order for formula to evaluate.

 

Hopefully its a bit clearer...I got lost myself trying to dissect it and I wrote it like 2 hours ago  

 

Soon, we will have access to new function "LET" which will help with writing formulas like this.

 

Best regards,

Highlighted

@Branislav1984 Thanks lot for explaining me the concept and now i could do more better in IF conditions.

 

Lets wait for LET function to come in future.

Highlighted

@Nandhu19940 Not that it matters much but just to demonstrate another, more dynamic, approach that does not require you to "hard-code" all the keywords into many nested IF statements. Create a list with keywords and give it a name. Then this will work as well:

=IFERROR(IF(AND($A$2:$A$11=1,$B$2:$B$11=FALSE,$D$2:$D$11="--",MATCH(C2,keywords,0)),"Required Action"),"x")

It's demonstrated in the attached workbook. Adopt the ranges to your real situation, give them names or use structured table references to make it really dynamic.

Highlighted

@Riny_van_Eekelen Such a wonderful way of minimizing the lengthy formula thanks lot Riny.

 

Queries:

1) Here in my count, com-result column values will differ and moreover rows can't be fixed in this section.

2) Dynamic rows will be there and need to implement formula accordingly so i tried below thing.

 

Formula:

 

=IFERROR(IF(AND(A2=$H$2,B2=$H$3,D2=$H$4, MATCH(C2,keywords,0)),"Required Action"),"x")

 

Because in your formula design i could see three column rows range is fixed but that won't workout for me and moreover my result for above formula is quite different because of using IFERROR it throws me FALSE when we not get match for A2, B2 & D2 column values with fixed one.

 

Performance issue: 

 

Another on thing here is my workbook has many rows (100000 + rows) data, so when i'm implementing the formula it's very slow and taking more time to implement for all rows.

 

So need to give work around on performance as well and let me know any tips you can avail for performance improvement in macro running.

 

Issue:

Calculating 2 processors (2%), i'm getting this one while running  my macro and taking too long time to finish it.

 

Highlighted

@Nandhu19940 Sorry, but I don't know enough about the technology "behind" all of it to understand what to do or not to do to boost performance.

Highlighted

@Nandhu19940 Based on your altered question, I have inserted your formula in my original sheet (attached) and it seems to work as intended. IF all four conditions are met (1, FALSE, -- and found in the list of keywords), THEN the required action will take place ELSE something else. That's exactly the point of the IFERROR statement. You still need to specify what needs to be done when the outcome of these four tests is FALSE. But perhaps I don't really understand the issue.