SOLVED

SUMIFS formulas in different Layout

%3CLINGO-SUB%20id%3D%22lingo-sub-2976389%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2976389%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1163132%22%20target%3D%22_blank%22%3E%40excel_learner%3C%2FA%3E%2C%26nbsp%3B%3CBR%20%2F%3Ethis%20table%20structure%20requires%20a%20relativly%20complex%20formula%20that%20includes%20the%20OFFSET-function.%20I%20have%20entered%20the%20formulas%20in%20column%20G%20of%20the%20Master%20sheet%20in%20the%20attached%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20be%20aware%20that%20it%20checks%20only%20the%20week%2C%20the%20area%20and%20the%20category%20value%20in%20row%202%20of%20the%20Master%20sheet.%20It%20does%20not%20consider%20the%20entries%20in%20column%20D%20(%22LDP%22).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%2C%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2976118%22%20slang%3D%22en-US%22%3ESUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2976118%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20know%20if%20this%20is%20possible.%20I'm%20trying%20to%20create%20a%20formula%20for%20two%20rows%20(Forecast%20%26amp%3B%20Actuals)%20The%20Actual%20data%20input%20sheet%20is%20laid%20out%20in%20a%20way%20I%20can%20easily%20do%20the%20SUMIFS%20formula%20to%20get%20the%20required%20information%20in%20each%20cell.%20The%20trouble%20I'm%20having%20is%20the%20forecast%20input%20sheet%20has%20the%20weeks%20going%20across%20like%20this.%3C%2FP%3E%3CTABLE%20width%3D%221761%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2267%22%3E%3CP%3E27%3C%2FP%3E%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E28%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E29%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E30%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E31%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E32%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E33%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E34%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E35%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E36%3C%2FTD%3E%3CTD%20width%3D%2267%22%3E37%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E38%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E39%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E40%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E41%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E42%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E43%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E44%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E45%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E46%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E47%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E48%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E49%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E50%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E51%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E52%3C%2FTD%3E%3CTD%20width%3D%2264%22%3E53%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20know%20how%20to%20structure%20the%20formula%20to%20show%20sum%20of%20forecasts%20for%20each%20row%20in%20my%20Master%20sheet%20using%20the%20adjacent%20rows%20for%20criteria.%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20how%20this%20can%20be%20done%3F%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20great.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2976118%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-2976838%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2976838%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F48469%22%20target%3D%22_blank%22%3E%40DTE%3C%2FA%3E%3CBR%20%2F%3EIs%20it%20possible%20to%20add%20one%20more%20criteria%20to%20the%20formula%20that%20being%20from%20LDP%20column%20%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2977582%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2977582%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1163132%22%20target%3D%22_blank%22%3E%40excel_learner%3C%2FA%3E%26nbsp%3BI%20created%20a%20'master%20formula%20for%20that%20column%20using%20SWITCH%20instead%20of%20IFS.%26nbsp%3B%20as%20opposed%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F48469%22%20target%3D%22_blank%22%3E%40DTE%3C%2FA%3E%26nbsp%3Busing%20OFFSET%20I%20used%20INDEX%20which%20is%20probably%206%20vs%201%2F2%20doz.%26nbsp%3B%20I%20included%20the%20added%20criteria%20but%20my%20problem%20and%20why%20I%20didn't%20post%20earlier%20and%20had%20to%20come%20back%20to%20it%20is%20that%20I%20found%20out%20that%20your%20LDP%20values%20on%20the%20Master%20do%20not%20match%20your%20LDP%20values%20on%20the%20Forecast.%26nbsp%3B%20I%20could%20add%20even%20more%20complexity%20to%20the%20formula%20but%20I%20think%20it%20might%20be%20better%20for%20you%20to%20just%20pick%20a%20convention%20and%20use%20it.%26nbsp%3B%20Here%20is%20the%20formula%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DSWITCH(%24E10764%2C%0A%22Forecast%22%2CIFERROR(SUMIFS(INDEX('Forecast%20Input'!%24A%3A%24BO%2C%2CMATCH(TEXT(%24A10764%2C%220%22)%2C'Forecast%20Input'!%241%3A%241%2C0))%2C'Forecast%20Input'!%24A%3A%24A%2CMaster!%24C10764%2C'Forecast%20Input'!%24D%3A%24D%2CMaster!%24D10764)%2C0)%2C%0A%22Actual%22%2CSUMIFS('CMO%20Input'!%24Q%3A%24Q%2C'CMO%20Input'!%24E%3A%24E%2CMaster!%24A10764%2C'CMO%20Input'!%24C%3A%24C%2CMaster!%24C10764%2C'CMO%20Input'!%24AJ%3A%24AJ%2CMaster!%24D10764%2C'CMO%20Input'!%24AU%3A%24AU%2CMaster!F%242)%2C%0A%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ealso%20it%20could%20be%20cleaner%20if%20you%20have%20Excel%20365%20and%20we%20could%20use%20LET()%20and%20FILTER()%20statements%20but%20you%20didn't%20tell%20us%20what%20version%20of%20Excel%20you%20are%20using.%3C%2FP%3E%3CP%3EIn%20the%20attached%20you%20can%20see%20the%20formula%20and%20if%20you%20ctrl-down%20in%20column%20G%20you%20will%20find%20where%20I%20figured%20out%20the%20problem%20with%20the%20LDP%20naming.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2977810%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2977810%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%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EThank%20you%20I%20have%20now%20changed%20the%20LDP%20Values%20to%20match%20master%20sheet%2C%20when%20you%20said%20I%20could%20add%20even%20more%20complexity%20to%20the%20formula%2C%20in%20what%20way%20may%20I%20ask%20please%20%3F%20I%20am%20using%20office%20365%2C%20could%20you%20possibly%20show%20a%20cleaner%20formula%20with%20LET()%20and%20FILTER().%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2981608%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2981608%22%20slang%3D%22en-US%22%3Esorry%20my%20comment%20%22I%20could%20add%20even%20more%20complexity%22%20was%20intended%20w%2Fr%20to%20adding%20additional%20parts%20to%20use%20partial%20matches%20to%20match%20the%20LDP%20values%20but%20you%20fixed%20that.%20As%20for%20using%20LET%20and%20FILTER%20I%20took%20a%20look%20and%20tried%20and%20find%20it%20marginal.%20I%20mean%20using%20LET%20you%20could%20'define'%20all%20the%20ranges%20and%20such%20(but%20you%20could%20also%20do%20that%20using%20the%20Name%20Manager)%20so%20the%20formula%20is%20clearer%20what%20you%20are%20pointing%20to.%20As%20for%20the%20FILTER%20or%20using%20XMATCH%20or%20XLOOKUP%20function%20they%20don't%20seem%20to%20add%20much%20since%20the%20SUMIFS%20is%20doing%20most%20of%20that%20also.%20There%20is%20some%20marginal%20benefit%20since%20those%20functions%20give%20an%20optional%20parameter%20for%20'if%20not%20found'%20instead%20of%20using%20IFERROR().%20so%20unless%20there%20is%20other%20reasons%2C%20I%20don't%20see%20much%20point%20in%20making%20the%20conversion%20in%20this%20case%20but%20do%20recommend%20you%20try%20them%20out%20when%20you%20have%20a%20chance.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2984452%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2984452%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%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20used%20the%20following%20formula%20but%20don't%20get%20any%20results%20for%20actuals%20also%20get%20the%20wrong%20totals%20on%20forecast%20for%20the%20specific%20categories.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20i%20used%20was%26nbsp%3B%3C%2FP%3E%3CP%3E%3DSWITCH(%24E6%2C%22Forecast%22%2CIFERROR(SUMIFS(INDEX('Forecast%20Input'!%24A%3A%24BO%2C%2CMATCH(TEXT(%24A6%2C%220%22)%2C'Forecast%20Input'!%241%3A%241%2C0))%2C'Forecast%20Input'!%24A%3A%24A%2CMaster!C6%2C'Forecast%20Input'!%24D%3A%24D%2CMaster!D6)%2C0)%2C%22Actual%22%2CSUMIFS('CMO%20Input'!%24Q%3A%24Q%2C'CMO%20Input'!%24E%3A%24E%2CMaster!%24A6%2C'CMO%20Input'!%24C%3A%24C%2CMaster!%24C6%2C'CMO%20Input'!%24AJ%3A%24AJ%2CMaster!%24D6%2C'CMO%20Input'!%24AU%3A%24AU%2CMaster!%24F2)%2C%22%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20notice%20the%20section%20of%20the%20formula%20for%20forecast%20doesn't%20have%20the%20category%20criteria%20from%20master%20sheet.%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20know%20how%20I%20can%20fix%20this%20to%20get%20the%20actuals%20and%20forecast%20based%20on%20categories%20in%20cells%26nbsp%3BF2%2C%20G2%2C%20H2%20etc%20of%20the%20Master%20sheet%20based%20on%20criteria%20of%20week%2C%20Area%2C%20LDP%2C%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2985736%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2985736%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1163132%22%20target%3D%22_blank%22%3E%40excel_learner%3C%2FA%3E%26nbsp%3Bno%20it%20doesn't%20use%20category%20criteria%20because%20I%20didn't%20see%20you%20requesting%20that%20but%20now%20looking%20at%20it%20we%20have%20another%20matching%20issue%3A%3C%2FP%3E%3CP%3EMaster%20sheet%20%3A%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mtarler_1-1637333881772.png%22%20style%3D%22width%3A%20218px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F328204i41B03928B0613973%2Fimage-dimensions%2F218x60%3Fv%3Dv2%22%20width%3D%22218%22%20height%3D%2260%22%20role%3D%22button%22%20title%3D%22mtarler_1-1637333881772.png%22%20alt%3D%22mtarler_1-1637333881772.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EForecast%20sheet%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mtarler_0-1637333812418.png%22%20style%3D%22width%3A%20112px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F328203iE921800677716960%2Fimage-dimensions%2F112x149%3Fv%3Dv2%22%20width%3D%22112%22%20height%3D%22149%22%20role%3D%22button%22%20title%3D%22mtarler_0-1637333812418.png%22%20alt%3D%22mtarler_0-1637333812418.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAs%20for%20the%20Actual%20not%20getting%20calculated%20i%20just%20used%20your%20formula.%26nbsp%3B%20The%20problem%20appears%20that%20you%20didn't%20%22lock%22%20row%202%20on%20the%20category%20conditional%20at%20the%20very%20end%20of%20the%20formula.%26nbsp%3B%20Basically%20%24F2%20should%20be%20F%242%20so%20the%20column%20F%20can%20move%20to%20column%20G%2C%20etc...%20when%20you%20copy%20the%20formula%20to%20those%20columns%20but%20row%202%20stays%20row%202%20when%20you%20copy%20down%20the%20column.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2985830%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2985830%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20silly%20mistake%20I%20did%20there%2C%20thank%20you%20for%20pointing%20that%20out%20though.%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20was%20to%20add%20the%20categories%20(F2%2CG2%2CH2%20and%20so%20on)%26nbsp%3B%20to%20the%20Forecast%20part%20of%20the%20syntax%20how%20can%20I%20do%20this%3F%3C%2FP%3E%3CP%3EThis%20would%20be%20so%20I%20can%20get%20the%20forecast%20based%20on%20the%20category%20in%20each%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2986235%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2986235%22%20slang%3D%22en-US%22%3EJust%20add%20it%20into%20the%20SUMIFS%20portion%20of%20the%20%22Forecast%22%20formula.%20Below%20I%20created%20line%20breaks%20and%20spacing%20to%20help%20show%20the%20formula%20better%20and%20where%20to%20add%20the%20new%20condition.%20Note%20I%20also%20added%20%22%24%22%20on%20Master!%24C6%20and%20%24D6.%20Note%20you%20can%20delete%20all%20the%20spaces%20and%20line%20returns%20but%20you%20can%20also%20paste%20it%20directly%20into%20Excel%20if%20you%20click%20into%20the%20formula%20bar%20and%20hit%20paste%20there%20(i.e.%20if%20you%20click%20on%20a%20cell%20and%20hit%20paste%20it%20will%20spread%20it%20over%20multiple%20cells).%3CBR%20%2F%3E%3DSWITCH(%24E6%2C%3CBR%20%2F%3E%22Forecast%22%2CIFERROR(SUMIFS(%3CBR%20%2F%3EINDEX('Forecast%20Input'!%24A%3A%24BO%2C%2CMATCH(TEXT(%24A6%2C%220%22)%2C'Forecast%20Input'!%241%3A%241%2C0))%2C%3CBR%20%2F%3E'Forecast%20Input'!%24A%3A%24A%2C%20Master!%24C6%2C%3CBR%20%2F%3E'Forecast%20Input'!%24D%3A%24D%2C%20Master!%24D6%2C%3CBR%20%2F%3E%5B%5B%5BADD%20RANGE%20TO%20CHECK%20%2C%20CONDITIONAL%5D%5D%5D%20)%3CBR%20%2F%3E%2C0)%2C%3CBR%20%2F%3E%22Actual%22%2CSUMIFS(%3CBR%20%2F%3E'CMO%20Input'!%24Q%3A%24Q%2C%3CBR%20%2F%3E'CMO%20Input'!%24E%3A%24E%2C%20Master!%24A6%2C%3CBR%20%2F%3E'CMO%20Input'!%24C%3A%24C%2C%20Master!%24C6%2C%3CBR%20%2F%3E'CMO%20Input'!%24AJ%3A%24AJ%2C%20Master!%24D6%2C%3CBR%20%2F%3E'CMO%20Input'!%24AU%3A%24AU%2C%20Master!F%242)%2C%3CBR%20%2F%3E%22%22)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2986633%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2986633%22%20slang%3D%22en-US%22%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BThank%20you%20so%20much%3CBR%20%2F%3EI%20have%20used%20this%20formula%20for%20each%20category%20I%20can%20for%20the%20time%20being.%3CBR%20%2F%3E%26lt%3B%3D3%22%20Actuals%20match%20CMO%20input%20sheet.%3CBR%20%2F%3E4%22-5%22%20Actuals%20match%20CMO%20input%20sheet.%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3E6-7%22%20Actuals%20don't%20match%20CMO%20input%20sheet%20%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CU%3E%3CEM%3ETotals%20on%20master%20sheet%20are%2064%2C719%3C%2FEM%3E%3C%2FU%3E%3C%2FFONT%3E%3C%2FLI%3E%3CLI%3E%3CFONT%20color%3D%22%23FF0000%22%3E%3CU%3E%3CEM%3ETotals%20on%20CMO%20input%20sheet%20is%2064%2C869%3C%2FEM%3E%3C%2FU%3E%3C%2FFONT%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3EIs%20there%20way%20I%26nbsp%3Bcan%20do%20any%20back%20testing%20with%20the%20data%20to%20see%20where%20the%20problem%20is%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2986779%22%20slang%3D%22en-US%22%3ERe%3A%20SUMIFS%20formulas%20in%20different%20Layout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2986779%22%20slang%3D%22en-US%22%3EI%20just%20looked%20at%20the%20columns%20being%20filtered%20to%20see%20which%20columns%20has%20additional%20names%20on%20the%20CMO%20sheet%20compared%20to%20the%20master.%20So%20using%20those%20drop%20down%20filters%20I%20saw%20the%20master%20has%20all%20the%20areas%20(and%20more).%20Then%20on%20the%20LDP%20columns%20I%20saw%20the%20CMO%20has%2011%20instead%20of%2010%20and%20identified%20%22I%20%26amp%3B%20G%22%20as%20the%20extra%20and%20when%20filtered%20for%20them%20found%20they%20account%20for%20150%20(the%20exact%20difference%20you%20found).%3C%2FLINGO-BODY%3E
Contributor

Hi All,

 

I want to know if this is possible. I'm trying to create a formula for two rows (Forecast & Actuals) The Actual data input sheet is laid out in a way I can easily do the SUMIFS formula to get the required information in each cell. The trouble I'm having is the forecast input sheet has the weeks going across like this.

27

2829303132333435363738394041424344454647484950515253

 

I don't know how to structure the formula to show sum of forecasts for each row in my Master sheet using the adjacent rows for criteria.

Does anyone know how this can be done?

Any help would be great.

 

16 Replies

Hi @excel_learner
this table structure requires a relativly complex formula that includes the OFFSET-function. I have entered the formulas in column G of the Master sheet in the attached file.

 

But be aware that it checks only the week, the area and the category value in row 2 of the Master sheet. It does not consider the entries in column D ("LDP").

 

Hope, this helps.

Hi @DTE
Is it possible to add one more criteria to the formula that being from LDP column ?

@excel_learner I created a 'master formula for that column using SWITCH instead of IFS.  as opposed to @DTE using OFFSET I used INDEX which is probably 6 vs 1/2 doz.  I included the added criteria but my problem and why I didn't post earlier and had to come back to it is that I found out that your LDP values on the Master do not match your LDP values on the Forecast.  I could add even more complexity to the formula but I think it might be better for you to just pick a convention and use it.  Here is the formula:

=SWITCH($E10764,
"Forecast",IFERROR(SUMIFS(INDEX('Forecast Input'!$A:$BO,,MATCH(TEXT($A10764,"0"),'Forecast Input'!$1:$1,0)),'Forecast Input'!$A:$A,Master!$C10764,'Forecast Input'!$D:$D,Master!$D10764),0),
"Actual",SUMIFS('CMO Input'!$Q:$Q,'CMO Input'!$E:$E,Master!$A10764,'CMO Input'!$C:$C,Master!$C10764,'CMO Input'!$AJ:$AJ,Master!$D10764,'CMO Input'!$AU:$AU,Master!F$2),
"")

also it could be cleaner if you have Excel 365 and we could use LET() and FILTER() statements but you didn't tell us what version of Excel you are using.

In the attached you can see the formula and if you ctrl-down in column G you will find where I figured out the problem with the LDP naming.

Hi @mtarler 
Thank you I have now changed the LDP Values to match master sheet, when you said I could add even more complexity to the formula, in what way may I ask please ? I am using office 365, could you possibly show a cleaner formula with LET() and FILTER().

sorry my comment "I could add even more complexity" was intended w/r to adding additional parts to use partial matches to match the LDP values but you fixed that. As for using LET and FILTER I took a look and tried and find it marginal. I mean using LET you could 'define' all the ranges and such (but you could also do that using the Name Manager) so the formula is clearer what you are pointing to. As for the FILTER or using XMATCH or XLOOKUP function they don't seem to add much since the SUMIFS is doing most of that also. There is some marginal benefit since those functions give an optional parameter for 'if not found' instead of using IFERROR(). so unless there is other reasons, I don't see much point in making the conversion in this case but do recommend you try them out when you have a chance.

Hi @mtarler 

I have used the following formula but don't get any results for actuals also get the wrong totals on forecast for the specific categories.

 

The formula i used was 

=SWITCH($E6,"Forecast",IFERROR(SUMIFS(INDEX('Forecast Input'!$A:$BO,,MATCH(TEXT($A6,"0"),'Forecast Input'!$1:$1,0)),'Forecast Input'!$A:$A,Master!C6,'Forecast Input'!$D:$D,Master!D6),0),"Actual",SUMIFS('CMO Input'!$Q:$Q,'CMO Input'!$E:$E,Master!$A6,'CMO Input'!$C:$C,Master!$C6,'CMO Input'!$AJ:$AJ,Master!$D6,'CMO Input'!$AU:$AU,Master!$F2),"")

 

I also notice the section of the formula for forecast doesn't have the category criteria from master sheet. 

Do you know how I can fix this to get the actuals and forecast based on categories in cells F2, G2, H2 etc of the Master sheet based on criteria of week, Area, LDP, 

@excel_learner no it doesn't use category criteria because I didn't see you requesting that but now looking at it we have another matching issue:

Master sheet : mtarler_1-1637333881772.png

Forecast sheet:

mtarler_0-1637333812418.png

As for the Actual not getting calculated i just used your formula.  The problem appears that you didn't "lock" row 2 on the category conditional at the very end of the formula.  Basically $F2 should be F$2 so the column F can move to column G, etc... when you copy the formula to those columns but row 2 stays row 2 when you copy down the column.

Hi@mtarler 

Sorry silly mistake I did there, thank you for pointing that out though. 

If I was to add the categories (F2,G2,H2 and so on)  to the Forecast part of the syntax how can I do this?

This would be so I can get the forecast based on the category in each column.

 

Just add it into the SUMIFS portion of the "Forecast" formula. Below I created line breaks and spacing to help show the formula better and where to add the new condition. Note I also added "$" on Master!$C6 and $D6. Note you can delete all the spaces and line returns but you can also paste it directly into Excel if you click into the formula bar and hit paste there (i.e. if you click on a cell and hit paste it will spread it over multiple cells).
=SWITCH($E6,
"Forecast",IFERROR(SUMIFS(
INDEX('Forecast Input'!$A:$BO,,MATCH(TEXT($A6,"0"),'Forecast Input'!$1:$1,0)),
'Forecast Input'!$A:$A, Master!$C6,
'Forecast Input'!$D:$D, Master!$D6,
[[[ADD RANGE TO CHECK , CONDITIONAL]]] )
,0),
"Actual",SUMIFS(
'CMO Input'!$Q:$Q,
'CMO Input'!$E:$E, Master!$A6,
'CMO Input'!$C:$C, Master!$C6,
'CMO Input'!$AJ:$AJ, Master!$D6,
'CMO Input'!$AU:$AU, Master!F$2),
"")
  • @mtarler Thank you so much
    I have used this formula for each category I can for the time being.
    <=3" Actuals match CMO input sheet.
    4"-5" Actuals match CMO input sheet.
    6-7" Actuals don't match CMO input sheet
  • Totals on master sheet are 64,719
  • Totals on CMO input sheet is 64,869

Is there way I can do any back testing with the data to see where the problem is

 

 

I just looked at the columns being filtered to see which columns has additional names on the CMO sheet compared to the master. So using those drop down filters I saw the master has all the areas (and more). Then on the LDP columns I saw the CMO has 11 instead of 10 and identified "I & G" as the extra and when filtered for them found they account for 150 (the exact difference you found).
Hi
Yes correct thank you for spotting this. I also spotted the same kind of issue in forecast input sheet where there is also one extra LDP “LDP Blank” making the forecast input different to masters total for each category.
Will need to adjust the whole master sheet in this case as each any new name should have a unique combination for each week.

Could you possibly explain the workings of the Switch and index forecast formula and what each of the functions do in the forecast part of this formula.


best response confirmed by excel_learner (Contributor)
Solution

sure. Switch is like a multiple IF statement. Instead of IF A=1 then ... ELSE IF A=2 then ... ELSE IF A=3 ... where you keep doing comparison against the same value, SWITCH just takes that one input and will SWITCH the output. If you type =SWITCH( into a cell then excel can show you the parameters but basically the value in question then pairs of condition, output so if the value meets a condition it will output that part.
INDEX will take an array or table and return the value or array that you specify. So an array of a,b,c,d,e,f and you index 3 then you get c. If it is a table you can specify both row and column to get a single value or just the row or just the col to get back the corresponding row or column. In your case here is the formula broken out with notes. I added a periods to create indenting but the word wrap may still make it confusing:
=SWITCH($E6, <<<this is the check value
"Forecast", <<<this is the first condition/check for switch
... IFERROR(SUMIFS(
...... INDEX('Forecast Input'!$A:$BO, <<< this is the range for the index
............. , <<< this is the row for the index (i.e. return all rows
.............. MATCH(TEXT($A6,"0"),'Forecast Input'!$1:$1,0)), <<< this match find the column you want for the index
........ 'Forecast Input'!$A:$A, Master!$C6, <<<this is a conditional pair for sumifs
........ 'Forecast Input'!$D:$D, Master!$D6, <<<this is a conditional pair for sumifs
........ [[[ADD RANGE TO CHECK , CONDITIONAL]]] ) <<<this is a conditional pair for sumifs
... ,0), <<< this is the value to return if error found
"Actual", <<<this is the second condition/check for switch
... SUMIFS(
......... 'CMO Input'!$Q:$Q,
......... 'CMO Input'!$E:$E, Master!$A6,
........ 'CMO Input'!$C:$C, Master!$C6,
........ 'CMO Input'!$AJ:$AJ, Master!$D6,
....... 'CMO Input'!$AU:$AU, Master!F$2),
"") <<< this is the default result for switch (i.e. if it didn't match any of the above

@mtarler Thank you

What does the part highlighted in red refer to

 MATCH(TEXT($A6,"0"),'Forecast Input'!$1:$1,0)), <<< this match find the column you want for the index  , ?

 

It is the row 1 on the Forecast sheet. basically find the column that has the title for the month you are interested in ($A6). I use TEXT($A6,"0") just to force A6 to be text so it will match. otherwise it won't find anything because 1 is a number and the other is text.

@mtarler  Thank you this helped a lot