SOLVED

Need for more than 64 levels of nested - Simplify formula

%3CLINGO-SUB%20id%3D%22lingo-sub-1861104%22%20slang%3D%22en-US%22%3ENeed%20for%20more%20than%2064%20levels%20of%20nested%20-%20Simplify%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861104%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20that%20experienced%20with%20Excel%20so%20I%20need%20your%20help%20with%20this.%20I%20have%20a%20very%20long%20formula%20with%2064%20levels%20of%20nested%20and%20I%20need%20to%20add%20more%20which%20is%20not%20allowed.%20I%20will%20copy%20and%20paste%20the%20formula%20here%20but%20although%20it%20might%20look%20very%20complicated%2C%20it%20is%20pretty%20much%20the%20same%20thing%20over%20and%20over%20again%20but%20with%20different%20values.%20I%20need%20to%20find%20a%20way%20to%20simplify%20it%2C%20so%20I%20don't%20get%20the%20error%20of%2064%20levels%20of%20nested%20if%20I%20add%20more.%20I%20thought%20to%20maybe%20use%20VLOOKUP%20but%20I%20have%20not%20used%20it%20before%20so%20I%20am%20not%20sure%20if%20it%20would%20work.%20Here%20is%20the%20formula%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(AND(G4%3D2016%2CI4%3D%22B250%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%243)%2C%22Below%22%2CIF(AND(G4%3D2016%2CI4%3D%22B250%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%243%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%243)%2C%22%22%2CIF(AND(G4%3D2016%2CI4%3D%22B250%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%243)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22B250%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%249)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22B250%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%249%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%249)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22B250%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%249)%2C%22Over%22%2CIF(AND(G4%3D2018%2CI4%3D%22B250%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2429)%2C%22Below%22%2CIF(AND(G4%3D2018%2CI4%3D%22B250%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2429%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2429)%2C%22%22%2CIF(AND(G4%3D2018%2CI4%3D%22B250%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2429)%2C%22Over%22%2CIF(AND(G2%3D2016%2CI2%3D%22C300%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%244)%2C%22Below%22%2CIF(AND(G2%3D2016%2CI2%3D%22C300%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%244%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%244)%2C%22%22%2CIF(AND(G2%3D2016%2CI2%3D%22C300%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%244)%2C%22Over%22%2CIF(AND(G2%3D2017%2CI2%3D%22C300%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2410)%2C%22Below%22%2CIF(AND(G2%3D2017%2CI2%3D%22C300%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2410%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2410)%2C%22%22%2CIF(AND(G2%3D2017%2CI2%3D%22C300%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2410)%2C%22Over%22%2CIF(AND(G2%3D2018%2CI2%3D%22C300%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2430)%2C%22Below%22%2CIF(AND(G2%3D2018%2CI2%3D%22C300%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2430%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2430)%2C%22%22%2CIF(AND(G2%3D2018%2CI2%3D%22C300%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2430)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22C%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2412)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22C300C%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2412%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2412)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22C300C%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2412)%2C%22Over%22%2CIF(AND(G4%3D2018%2CI4%3D%22C300C%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2431)%2C%22Below%22%2CIF(AND(G4%3D2018%2CI4%3D%22C300C%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2431%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2431)%2C%22%22%2CIF(AND(G4%3D2018%2CI4%3D%22C300C%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2431)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22C300A%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2411)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22C300A%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2411%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2411)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22C300A%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2411)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2413)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2413%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2413)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2413)%2C%22Over%22%2CIF(AND(G4%3D2018%2CI4%3D%22C43%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2432)%2C%22Below%22%2CIF(AND(G4%3D2018%2CI4%3D%22C43%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2432%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2432)%2C%22%22%2CIF(AND(G4%3D2018%2CI4%3D%22C43%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2432)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43A%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2414)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43A%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2414%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2414)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43A%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2414)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43C%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2415)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43C%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2415%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2415)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22C43C%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2415)%2C%22Over%22%2CIF(AND(G4%3D2018%2CI4%3D%22C43C%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2433)%2C%22Below%22%2CIF(AND(G4%3D2018%2CI4%3D%22C43C%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2433%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2433)%2C%22%22%2CIF(AND(G4%3D2018%2CI4%3D%22C43C%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2433)%2C%22Over%22%2CIF(AND(G4%3D2016%2CI4%3D%22CLA250M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%246)%2C%22Below%22%2CIF(AND(G4%3D2016%2CI4%3D%22CLA250M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%246%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%246)%2C%22%22%2CIF(AND(G4%3D2016%2CI4%3D%22CLA250M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%246)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22CLA250M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2417)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22CLA250M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2417%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2417)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22CLA250M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2417)%2C%22Over%22%2CIF(AND(G4%3D2018%2CI4%3D%22CLA250M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2434)%2C%22Below%22%2CIF(AND(G4%3D2018%2CI4%3D%22CLA250M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2434%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2434)%2C%22%22%2CIF(AND(G4%3D2018%2CI4%3D%22CLA250M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2434)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22CLA45%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2418)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22CLA45%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2418%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2418)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22CLA45%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2418)%2C%22Over%22%2CIF(AND(G4%3D2016%2CI4%3D%22GLA250M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%247)%2C%22Below%22%2CIF(AND(G4%3D2016%2CI4%3D%22GLA250M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%247%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%247)%2C%22%22%2CIF(AND(G4%3D2016%2CI4%3D%22GLA250M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%247)%2C%22Over%22%2CIF(AND(G4%3D2017%2CI4%3D%22GLA250M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2422)%2C%22Below%22%2CIF(AND(G4%3D2017%2CI4%3D%22GLA250M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2422%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2422)%2C%22%22%2CIF(AND(G4%3D2017%2CI4%3D%22GLA250M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2422)%2C%22Over%22%2CIF(AND(G4%3D2018%2CI4%3D%22GLA250M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2436)%2C%22Below%20Pricing%20Matrix%22%2CIF(AND(G4%3D2018%2CI4%3D%22GLA250M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2436%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2436)%2C%22In%20Accordance%20With%20Pricing%20Matrix%22%2CIF(AND(G4%3D2018%2CI4%3D%22GLA250M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2436)%2C%22Exceeds%20Pricing%20Matrix%22%2CIF(AND(G4%3D2018%2CI4%3D%22GLC300%204M%22%2CEW2%26lt%3B'Pricing%20Matrix'!%24D%2437)%2C%22Below%20Pricing%20Matrix%22%2CIF(AND(G4%3D2018%2CI4%3D%22GLC300%204M%22%2CEW2%26gt%3B%3D'Pricing%20Matrix'!%24D%2437%2CEW2%26lt%3B%3D'Pricing%20Matrix'!%24E%2437)%2C%22In%20Accordance%20With%20Pricing%20Matrix%22%2CIF(AND(G4%3D2018%2CI4%3D%22GLC300%204M%22%2CEW2%26gt%3B'Pricing%20Matrix'!%24E%2437)%2C%22Exceeds%20Pricing%20Matrix%22%2C%22N%2FA%22)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20appreciate%20your%20help%20in%20advance!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1861104%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20on%20mobile%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861311%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20for%20more%20than%2064%20levels%20of%20nested%20-%20Simplify%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861311%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%2F854944%22%20target%3D%22_blank%22%3E%40Nikoss%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThis%20is%20indeed%20a%20very%20long%20formula%20and%20as%20you%20said%2C%20there's%20got%20to%20be%20a%20way%20to%20make%20it%20shorter.%3C%2FP%3E%3CP%3ECan%20you%20share%20your%20spreadsheet%20or%20at%20least%20part%20of%20it%20to%20better%20assist%20you%3F%20Make%20sure%20there's%20no%20confidential%20data.%20I'm%20especially%20interested%20in%20the%20'Pricing%20Matrix'%20sheet.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861716%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20for%20more%20than%2064%20levels%20of%20nested%20-%20Simplify%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861716%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F854944%22%20target%3D%22_blank%22%3E%40Nikoss%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20this...%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(EW4%3CINDEX%3E%3DINDEX('Pricing%20Matrix'!D%3AD%2CMATCH(G4%26amp%3BI4%2C'Pricing%20Matrix'!B%3AB%26amp%3B'Pricing%20Matrix'!C%3AC%2C0))%2CEW4%26lt%3B%3DINDEX('Pricing%20Matrix'!E%3AE%2CMATCH(G4%26amp%3BI4%2C'Pricing%20Matrix'!B%3AB%26amp%3B'Pricing%20Matrix'!C%3AC%2C0)))%2C%22In%20accordance%20with%20Pricing%20Matrix%22%2CIF(EW4%26gt%3BINDEX('Pricing%20Matrix'!E%3AE%2CMATCH(G4%26amp%3BI4%2C'Pricing%20Matrix'!B%3AB%26amp%3B'Pricing%20Matrix'!C%3AC%2C0))%2C%22Over%22%2C%22NA%22)))%3C%2FINDEX%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIt%20is%20dynamic%20and%20flexible%20as%20you%20add%20more%20data%20in%20your%20Pricing%20Matrix%20sheet.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861348%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20for%20more%20than%2064%20levels%20of%20nested%20-%20Simplify%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861348%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F703724%22%20target%3D%22_blank%22%3E%40Bennadeau%3C%2FA%3E%26nbsp%3BThank%20you%20for%20the%20prompt%20response.%20I%20have%20attached%20a%20screenshot%20of%20it.%20The%20values%20on%20Column%20D%20and%20E%20are%20supposed%20to%20be%20prices%20but%20because%20that%20is%20confidential%20I%20have%20replaced%20them.%20I%20hope%20that%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862673%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20for%20more%20than%2064%20levels%20of%20nested%20-%20Simplify%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862673%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F703724%22%20target%3D%22_blank%22%3E%40Bennadeau%3C%2FA%3E%26nbsp%3Byes%20that%20was%20a%20mistake%20from%20my%20end%2C%20which%20I%20noticed%20the%20moment%20I%20posted%20the%20question%2C%20but%20I%20didn't%20want%20to%20make%20things%20more%20complicated%2C%20that%20is%20why%20I%20didn't%20mention%20it%20and%20corrected%20the%20mistake%20on%20my%20end.%20Maybe%20there%20is%20a%20mistake%20on%20the%20sample%20you%20sent%20me%20because%20I%20don't%20see%20the%20formula%20on%20L4.%20L4%20formula%20is%20%22%3DI17%22%20and%20the%20result%20is%20%220%22%20(since%20I17%20is%20blank).%3C%2FP%3E%3CP%3EI%20am%20sure%20you%20have%20understood%20by%20now%20what%20I%20am%20trying%20to%20do%20but%20just%20to%20be%20100%25%20sure%20here%20is%20an%20explanation%20based%20on%20the%20sample%20you%20sent%20me%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20If%20%22G4%22%20matches%20any%20of%20the%20cells%20from%20Pricing%20Matrix%20Column%20B%2C%20%22I4%22%20matches%20any%20of%20the%20cells%20from%20Pricing%20Matrix%20Column%20C%20and%20%22EW2%22%20is%20smaller%20than%20Pricing%20Matrix%20cell%20%22D4%22%20then%20the%20result%20should%20be%20%22Below%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%26nbsp%3BIf%20%22G4%22%20matches%20any%20of%20the%20cells%20from%20Pricing%20Matrix%20Column%20B%2C%20%22I4%22%20matches%20any%20of%20the%20cells%20from%20Pricing%20Matrix%20Column%20C%2C%20%22EW2%22%20is%20equal%20or%20greater%20than%20Pricing%20Matrix%20cell%20%22D4%22%20and%20equal%20or%20smaller%20than%26nbsp%3BPricing%20Matrix%20cell%20%22E4%22%2C%20then%20the%20result%20should%20be%20%22In%20Accordance%20with%20Pricing%20Matrix%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3.%26nbsp%3BIf%20%22G4%22%20matches%20any%20of%20the%20cells%20from%20Pricing%20Matrix%20Column%20B%2C%20%22I4%22%20matches%20any%20of%20the%20cells%20from%20Pricing%20Matrix%20Column%20C%20and%20%22EW2%22%20is%20greater%20than%20Pricing%20Matrix%20cell%20%22E4%22%20then%20the%20result%20should%20be%20%22Over%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20attached%20your%20sample%20worksheet%20as%20well.%20I%20have%20copied%20and%20paste%20your%20formula%20on%20EX2%20and%20as%20you%20can%20see%20I%20get%20the%20same%20%23VALUE!%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20really%20appreciate%20your%20help%20with%20this%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F703724%22%20target%3D%22_blank%22%3E%40Bennadeau%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hello guys,

 

I am not that experienced with Excel so I need your help with this. I have a very long formula with 64 levels of nested and I need to add more which is not allowed. I will copy and paste the formula here but although it might look very complicated, it is pretty much the same thing over and over again but with different values. I need to find a way to simplify it, so I don't get the error of 64 levels of nested if I add more. I thought to maybe use VLOOKUP but I have not used it before so I am not sure if it would work. Here is the formula:

 

=IF(AND(G4=2016,I4="B250 4M",EW2<'Pricing Matrix'!$D$3),"Below",IF(AND(G4=2016,I4="B250 4M",EW2>='Pricing Matrix'!$D$3,EW2<='Pricing Matrix'!$E$3),"",IF(AND(G4=2016,I4="B250 4M",EW2>'Pricing Matrix'!$E$3),"Over",IF(AND(G4=2017,I4="B250 4M",EW2<'Pricing Matrix'!$D$9),"Below",IF(AND(G4=2017,I4="B250 4M",EW2>='Pricing Matrix'!$D$9,EW2<='Pricing Matrix'!$E$9),"",IF(AND(G4=2017,I4="B250 4M",EW2>'Pricing Matrix'!$E$9),"Over",IF(AND(G4=2018,I4="B250 4M",EW2<'Pricing Matrix'!$D$29),"Below",IF(AND(G4=2018,I4="B250 4M",EW2>='Pricing Matrix'!$D$29,EW2<='Pricing Matrix'!$E$29),"",IF(AND(G4=2018,I4="B250 4M",EW2>'Pricing Matrix'!$E$29),"Over",IF(AND(G2=2016,I2="C300 4M",EW2<'Pricing Matrix'!$D$4),"Below",IF(AND(G2=2016,I2="C300 4M",EW2>='Pricing Matrix'!$D$4,EW2<='Pricing Matrix'!$E$4),"",IF(AND(G2=2016,I2="C300 4M",EW2>'Pricing Matrix'!$E$4),"Over",IF(AND(G2=2017,I2="C300 4M",EW2<'Pricing Matrix'!$D$10),"Below",IF(AND(G2=2017,I2="C300 4M",EW2>='Pricing Matrix'!$D$10,EW2<='Pricing Matrix'!$E$10),"",IF(AND(G2=2017,I2="C300 4M",EW2>'Pricing Matrix'!$E$10),"Over",IF(AND(G2=2018,I2="C300 4M",EW2<'Pricing Matrix'!$D$30),"Below",IF(AND(G2=2018,I2="C300 4M",EW2>='Pricing Matrix'!$D$30,EW2<='Pricing Matrix'!$E$30),"",IF(AND(G2=2018,I2="C300 4M",EW2>'Pricing Matrix'!$E$30),"Over",IF(AND(G4=2017,I4="C",EW2<'Pricing Matrix'!$D$12),"Below",IF(AND(G4=2017,I4="C300C 4M",EW2>='Pricing Matrix'!$D$12,EW2<='Pricing Matrix'!$E$12),"",IF(AND(G4=2017,I4="C300C 4M",EW2>'Pricing Matrix'!$E$12),"Over",IF(AND(G4=2018,I4="C300C 4M",EW2<'Pricing Matrix'!$D$31),"Below",IF(AND(G4=2018,I4="C300C 4M",EW2>='Pricing Matrix'!$D$31,EW2<='Pricing Matrix'!$E$31),"",IF(AND(G4=2018,I4="C300C 4M",EW2>'Pricing Matrix'!$E$31),"Over",IF(AND(G4=2017,I4="C300A 4M",EW2<'Pricing Matrix'!$D$11),"Below",IF(AND(G4=2017,I4="C300A 4M",EW2>='Pricing Matrix'!$D$11,EW2<='Pricing Matrix'!$E$11),"",IF(AND(G4=2017,I4="C300A 4M",EW2>'Pricing Matrix'!$E$11),"Over",IF(AND(G4=2017,I4="C43 4M",EW2<'Pricing Matrix'!$D$13),"Below",IF(AND(G4=2017,I4="C43 4M",EW2>='Pricing Matrix'!$D$13,EW2<='Pricing Matrix'!$E$13),"",IF(AND(G4=2017,I4="C43 4M",EW2>'Pricing Matrix'!$E$13),"Over",IF(AND(G4=2018,I4="C43 4M",EW2<'Pricing Matrix'!$D$32),"Below",IF(AND(G4=2018,I4="C43 4M",EW2>='Pricing Matrix'!$D$32,EW2<='Pricing Matrix'!$E$32),"",IF(AND(G4=2018,I4="C43 4M",EW2>'Pricing Matrix'!$E$32),"Over",IF(AND(G4=2017,I4="C43A 4M",EW2<'Pricing Matrix'!$D$14),"Below",IF(AND(G4=2017,I4="C43A 4M",EW2>='Pricing Matrix'!$D$14,EW2<='Pricing Matrix'!$E$14),"",IF(AND(G4=2017,I4="C43A 4M",EW2>'Pricing Matrix'!$E$14),"Over",IF(AND(G4=2017,I4="C43C 4M",EW2<'Pricing Matrix'!$D$15),"Below",IF(AND(G4=2017,I4="C43C 4M",EW2>='Pricing Matrix'!$D$15,EW2<='Pricing Matrix'!$E$15),"",IF(AND(G4=2017,I4="C43C 4M",EW2>'Pricing Matrix'!$E$15),"Over",IF(AND(G4=2018,I4="C43C 4M",EW2<'Pricing Matrix'!$D$33),"Below",IF(AND(G4=2018,I4="C43C 4M",EW2>='Pricing Matrix'!$D$33,EW2<='Pricing Matrix'!$E$33),"",IF(AND(G4=2018,I4="C43C 4M",EW2>'Pricing Matrix'!$E$33),"Over",IF(AND(G4=2016,I4="CLA250M",EW2<'Pricing Matrix'!$D$6),"Below",IF(AND(G4=2016,I4="CLA250M",EW2>='Pricing Matrix'!$D$6,EW2<='Pricing Matrix'!$E$6),"",IF(AND(G4=2016,I4="CLA250M",EW2>'Pricing Matrix'!$E$6),"Over",IF(AND(G4=2017,I4="CLA250M",EW2<'Pricing Matrix'!$D$17),"Below",IF(AND(G4=2017,I4="CLA250M",EW2>='Pricing Matrix'!$D$17,EW2<='Pricing Matrix'!$E$17),"",IF(AND(G4=2017,I4="CLA250M",EW2>'Pricing Matrix'!$E$17),"Over",IF(AND(G4=2018,I4="CLA250M",EW2<'Pricing Matrix'!$D$34),"Below",IF(AND(G4=2018,I4="CLA250M",EW2>='Pricing Matrix'!$D$34,EW2<='Pricing Matrix'!$E$34),"",IF(AND(G4=2018,I4="CLA250M",EW2>'Pricing Matrix'!$E$34),"Over",IF(AND(G4=2017,I4="CLA45 4M",EW2<'Pricing Matrix'!$D$18),"Below",IF(AND(G4=2017,I4="CLA45 4M",EW2>='Pricing Matrix'!$D$18,EW2<='Pricing Matrix'!$E$18),"",IF(AND(G4=2017,I4="CLA45 4M",EW2>'Pricing Matrix'!$E$18),"Over",IF(AND(G4=2016,I4="GLA250M",EW2<'Pricing Matrix'!$D$7),"Below",IF(AND(G4=2016,I4="GLA250M",EW2>='Pricing Matrix'!$D$7,EW2<='Pricing Matrix'!$E$7),"",IF(AND(G4=2016,I4="GLA250M",EW2>'Pricing Matrix'!$E$7),"Over",IF(AND(G4=2017,I4="GLA250M",EW2<'Pricing Matrix'!$D$22),"Below",IF(AND(G4=2017,I4="GLA250M",EW2>='Pricing Matrix'!$D$22,EW2<='Pricing Matrix'!$E$22),"",IF(AND(G4=2017,I4="GLA250M",EW2>'Pricing Matrix'!$E$22),"Over",IF(AND(G4=2018,I4="GLA250M",EW2<'Pricing Matrix'!$D$36),"Below Pricing Matrix",IF(AND(G4=2018,I4="GLA250M",EW2>='Pricing Matrix'!$D$36,EW2<='Pricing Matrix'!$E$36),"In Accordance With Pricing Matrix",IF(AND(G4=2018,I4="GLA250M",EW2>'Pricing Matrix'!$E$36),"Exceeds Pricing Matrix",IF(AND(G4=2018,I4="GLC300 4M",EW2<'Pricing Matrix'!$D$37),"Below Pricing Matrix",IF(AND(G4=2018,I4="GLC300 4M",EW2>='Pricing Matrix'!$D$37,EW2<='Pricing Matrix'!$E$37),"In Accordance With Pricing Matrix",IF(AND(G4=2018,I4="GLC300 4M",EW2>'Pricing Matrix'!$E$37),"Exceeds Pricing Matrix","N/A")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

 

I appreciate your help in advance!

 

Thank you,

20 Replies
Highlighted

Hi @Nikoss,

This is indeed a very long formula and as you said, there's got to be a way to make it shorter.

Can you share your spreadsheet or at least part of it to better assist you? Make sure there's no confidential data. I'm especially interested in the 'Pricing Matrix' sheet. 

Highlighted

@Bennadeau Thank you for the prompt response. I have attached a screenshot of it. The values on Column D and E are supposed to be prices but because that is confidential I have replaced them. I hope that helps.

Highlighted

@Nikoss 

Try this... 

=IF(EW4<INDEX('Pricing Matrix'!D:D,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"Below",IF(AND(EW4>=INDEX('Pricing Matrix'!D:D,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),EW4<=INDEX('Pricing Matrix'!E:E,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0))),"In accordance with Pricing Matrix",IF(EW4>INDEX('Pricing Matrix'!E:E,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"Over","NA")))

It is dynamic and flexible as you add more data in your Pricing Matrix sheet.

Highlighted

@Bennadeau unfortunately I get a #VALUE error with this formula

Highlighted

@Nikoss 

There was a small error in my original formula. Try this one.

=IF(EW2<INDEX('Pricing Matrix'!D:D,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"Below",IF(AND(EW2>=INDEX('Pricing Matrix'!D:D,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),EW2<=INDEX('Pricing Matrix'!E:E,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0))),"In accordance with Pricing Matrix",IF(EW2>INDEX('Pricing Matrix'!E:E,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"Over","NA")))

I also attached a sample workbook. Cell L4 is where the formula is. Perhaps I missed something in your explanation so you can see how I based the formula?

 

I see in your formula that you reference cell G4 for the date and I4 for the model but suddenly, it jumps to cell G2 and I2. I assumed this was a mistake in your formula, let me know if I'm wrong there.

Highlighted

@Bennadeau yes that was a mistake from my end, which I noticed the moment I posted the question, but I didn't want to make things more complicated, that is why I didn't mention it and corrected the mistake on my end. Maybe there is a mistake on the sample you sent me because I don't see the formula on L4. L4 formula is "=I17" and the result is "0" (since I17 is blank).

I am sure you have understood by now what I am trying to do but just to be 100% sure here is an explanation based on the sample you sent me:

 

1. If "G4" matches any of the cells from Pricing Matrix Column B, "I4" matches any of the cells from Pricing Matrix Column C and "EW2" is smaller than Pricing Matrix cell "D4" then the result should be "Below"

 

2. If "G4" matches any of the cells from Pricing Matrix Column B, "I4" matches any of the cells from Pricing Matrix Column C, "EW2" is equal or greater than Pricing Matrix cell "D4" and equal or smaller than Pricing Matrix cell "E4", then the result should be "In Accordance with Pricing Matrix"

 

3. If "G4" matches any of the cells from Pricing Matrix Column B, "I4" matches any of the cells from Pricing Matrix Column C and "EW2" is greater than Pricing Matrix cell "E4" then the result should be "Over"

 

I have attached your sample worksheet as well. I have copied and paste your formula on EX2 and as you can see I get the same #VALUE! error.

 

I really appreciate your help with this @Bennadeau 

 

Thank you,

Highlighted
@Nikoss
Some weird thing happened with that formula. I'm uploading a revised version of the doc. Hopefully it will work fine now.
Highlighted

@Nikoss  Alternatively I think this works:

 

=CHOOSE(IFERROR(SUM(--((FILTER('Pricing Matrix'!D:E,Sheet1!G4&Sheet1!I4='Pricing Matrix'!B:B&'Pricing Matrix'!C:C,"NA")-EW4)>=0))+2,1),"NA","Over","In accordance with Pricing Matrix","Under")

 

see attached sheet.

Also, you can make use of the IFS() function to eliminate nested IF() statements.

Highlighted

@Bennadeau although it works on the sample sheet it doesnt work on my original one for some reason so something is wrong with the original one probably. Again, I would like to thank you for your help on this, it is very much appreciated!

Highlighted

@mtarler Thanks a lot for your response. My version of excel doesn't support the "FILTER" function apparently. Would you be kind enough to give me an example of what the formula would look like with IFS function?

Highlighted

@Nikoss 

You may want to check to make sure your cell formatting match. 

Number formatting when only numbers are present

Currency when it's a $ amount

Text for everything else.

In both sheets of course. 

Also, ensure there is no trailing space in your cells (white space at the end or "2016" for example). This will mess up things.

Highlighted

@Nikoss  Here are 2 versions you can try.  1 using IFS and the other using CHOOSE and SUMPRODUCT:

=IFS(EW2<INDEX('Pricing Matrix'!D:D,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"Below",EW2<=INDEX('Pricing Matrix'!E:E,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"In accordance with Pricing Matrix",EW2>INDEX('Pricing Matrix'!E:E,MATCH(G4&I4,'Pricing Matrix'!B:B&'Pricing Matrix'!C:C,0)),"Over",TRUE,"NA")
=CHOOSE(SUMPRODUCT((--('Pricing Matrix'!D:D<=EW4)--('Pricing Matrix'!E:E<EW4)+1)*('Pricing Matrix'!B:B=Sheet1!G4)*('Pricing Matrix'!C:C=Sheet1!I4))+1,"NA","Under","In accordance with Pricing Matrix","Over")

 

 

Highlighted

@Bennadeau I checked and everything seems fine. I will not give up though and I will find what the problem is.

Highlighted

@Nikoss 

If by any chance you could make a copy of that workbook, remove everything confidential in it (actual price, client info if any and so on) and upload it here it would help me help you.

Highlighted

@Bennadeau Unfortunately I cannot as it has way too much confidential information and the moment i change it it messes up all the formulas etc.

Highlighted

@mtarler Apparently my excel version doesn't support IFS function either. The second formula you sent me though which is supported is giving me the wrong results for some reason even on the sample worksheet you sent me.

 

 

Highlighted
Best Response confirmed by Nikoss (Occasional Contributor)
Solution

@Nikoss I and re-attaching the sheet.  I deleted the other formulas on that sheet in case there was some confusion.  It works just fine for me.  Maybe you could explain a little more what you mean by it giving the wrong results.  Does it sometimes give correct results?  Does it ever change?  Can you give an example of a wrong result and what it gave and what you wanted it to give?

Highlighted

@Bennadeau here is a video of the calculation steps of the formula if that helps somehow: https://photos.app.goo.gl/mQ9gXihuwPtuKxyc9 

Highlighted

@mtarler Yesssssss this works!!!!!!!!!!!! Thank you soooo much!!!!! I have been trying to figure this out for almost a week! I really really appreciate your help!