SOLVED
Home

Copy Data to Other Sheets' Columns Based on Criteria

%3CLINGO-SUB%20id%3D%22lingo-sub-109266%22%20slang%3D%22en-US%22%3ECopy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109266%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20one%20Orders%20sheet%20and%2012%20Month%20sheets%20(Jan%2C%20Feb%2C%20Mar%2C%20etc).%26nbsp%3B%20The%20Orders%20sheet%20has%20five%20columns%3A%20Dept%2C%20Vendor%2C%20Brand%2C%20Cost%20and%20Date.%26nbsp%3B%20The%20Dept%20column%20has%20ten%20different%20options%20ie%20Truck%2C%20Car%2C%20RV%2C%20Boat%2C%20etc.%26nbsp%3B%20The%20Orders%20sheet%20will%20have%20all%20the%20order%20data%20for%20an%20entire%20year.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Month%20sheets%20have%20the%20same%20columns%20as%20the%20Orders%20sheet%20excluding%20the%20Dept%20and%20Cost%20columns.%20Instead%20of%20one%20column%20for%20Dept%20there%20are%2010%20columns%2C%20one%20for%20each%20of%20the%20options.%20These%20columns%20will%20be%20populated%20with%20the%20cost%20of%20each%20option.%26nbsp%3B%20This%20makes%20a%20total%20of%2013%20columns%20on%20the%20Month%20sheets.%26nbsp%3B%20Vendor%2C%20Brand%20and%20Date%20columns%20are%20A1%3AA3%20and%20the%20Dept%20options%20columns%20are%20A4%3A13.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20populate%20the%20Month%20sheets%20based%20on%20the%20Date%20column%20from%20the%20Orders%20sheet.%26nbsp%3B%20For%20example%2C%20all%20the%20orders%20between%20Jan%201%20and%20Jan%2031%20would%20appear%20on%20the%20Jan%20sheet%2C%20all%20the%20orders%20from%20Feb%201%20to%20Feb%2028%20on%20the%20Feb%20sheet%20and%20so%20on%20for%20the%20remaining%20Month%20sheets.%26nbsp%3B%20Depending%20on%20the%20option%20selected%20in%20the%20Dept%20column%20of%20the%20Orders%20sheet%2C%20I%20would%20like%20the%20associated%20cost%20to%20populate%20the%20corresponding%20options%20column%20on%20the%20Month%20sheet.%20For%20example%2C%20if%20on%20the%20Orders%20sheet%20an%20RV%20was%20entered%20at%20a%20cost%20of%20%2435%2C000%2C%20that%20cost%20would%20be%20transferred%20to%20the%20Month%20sheet%20to%20the%20appropriate%20option%20column.%26nbsp%3B%20In%20this%20case%20the%20RV%20column.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20sum%20up%2C%20each%20row%20in%20the%20Month%20sheets%20would%20have%20the%20Vendor%2C%20Brand%2C%20Date%20and%20Cost%20in%20the%20appropriate%20option%20column.%26nbsp%3B%20This%20data%20would%20be%20auto%20populated%20from%20the%20Orders%20sheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20formula(s)%20that%20makes%20this%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-109266%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20%26amp%3B%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeed%20Help%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-111245%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-111245%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20the%20help.%26nbsp%3B%20Works%20like%20a%20champ!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-110422%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-110422%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Rob%2C%3CBR%20%2F%3E%3CBR%20%2F%3EYes%20there%20is.%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EClick%20the%20dropdown%20ont%20he%20model%20field%2C%20and%20click%20field%20settings.%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20278px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F20976iC72DC9B9EA042BB3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3Eunder%20the%20Layout%20%26amp%3B%20Print%20tab%20click%20show%20items%20with%20no%20data.%20Click%20okay%20and%20generate%20the%20Report%20Filter%20Pages%20again.%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20510px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F20977i9E7C61B56EAC6047%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-110274%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-110274%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Argelo!%20Some%20months%20I%20will%20not%20have%20an%20RV%20in%20Orders%20sheet.%26nbsp%3B%20Is%20there%20a%20way%20to%20include%20a%20column%20for%20RV%20for%20those%20month%20on%20the%20pivot%20table%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109801%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109801%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Rob%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20addition%20to%20PivotTable%20solution%20which%20Argelo%20suggested%20here%20are%20couple%20more.%20Which%20one%20to%20use%20depends%20on%20many%20factors%2C%20from%20Excel%20versions%20and%20do%20you%20use%20predefined%20forms%20or%20not%3B%20to%20personal%20preferences.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%20first%20one%20using%20array%20formulas%20(Ctrl%2BShift%2BEnter)%20to%20add.%20Let%20assume%20your%20data%20is%20located%20as%3C%2FP%3E%3CP%3Eorders%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20638px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F20754i4B0D84C3CA3B46C0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Orders.JPG%22%20title%3D%22Orders.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Emonth%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20557px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F20755i8888B6BF1196626F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Month.JPG%22%20title%3D%22Month.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20pattern%20for%20the%20formula%20which%20extract%20data%20from%20master%20list%20based%20on%20criteria%20is%20described%20here%26nbsp%3B%3CA%20href%3D%22http%3A%2F%2Fwww.exceltactics.com%2Fmake-filtered-list-sub-arrays-excel-using-small%2F4%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.exceltactics.com%2Fmake-filtered-list-sub-arrays-excel-using-small%2F4%2F%3C%2FA%3E%20and%20in%20many%20other%20places.%3C%2FP%3E%3CP%3EIn%20our%20case%20in%20monthly%20sheet%20in%20A2%20let%20add%3C%2FP%3E%3CPRE%3E%3DIFERROR(%0A%20%20%20INDEX(Orders!%24A%242%3A%24C%24660%2C%0A%20%20%20%20%20%20SMALL(%0A%20%20%20%20%20%20%20%20%20IF((MONTH(Orders!%24A%242%3A%24A%24660)%3D%24H%241)*(Orders!%24A%242%3A%24A%24660%26gt%3B1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20ROW(Orders!%24A%242%3A%24A%24660)%20-%20ROW(Orders!%24A%242)%2B1%0A%20%20%20%20%20%20%20%20%20)%2CROW(1%3A1)%0A%20%20%20%20%20%20)%2C%3CSTRONG%3E1%3C%2FSTRONG%3E%0A%20%20%20)%2C%22%22%0A)%3C%2FPRE%3E%3CP%3EWe%20take%20660-rows%20range%20in%20Orders%20to%20have%20some%20gap.%20If%20fortunatelly%20you%20have%20more%20it%20is%20to%20be%20increased.%20Formula%20return%20first%20date%20in%20orders%20for%20defined%20in%20cell%20%24H%241%20month.%20Dates%20is%20first%20column%20in%20the%20range%2C%20in%20bold%20above%20in%20formula.%3C%2FP%3E%3CP%3ECopy%20this%20formula%20in%20B2%20and%20change%201%20on%203%20to%20receive%20data%20from%20third%20column%20%22Make%22.%3C%2FP%3E%3CP%3ETo%20receive%20the%20cost%20by%20type%20for%20this%20record%20in%20C2%20add%3C%2FP%3E%3CPRE%3E%3DIFERROR(%0A%20%20%20INDEX(Orders!%24F%242%3A%24F%24660%2C%0A%20%20%20%20%20%20MATCH(1%2C%0A%20%20%20%20%20%20%20%20%20(Orders!%24A%242%3A%24A%24660%3D%24A2)*%0A%20%20%20%20%20%20%20%20%20(Orders!%24C%242%3A%24C%24660%3D%24B2)*%0A%20%20%20%20%20%20%20%20%20(Orders!%24B%242%3A%24B%24660%3DC%241)%2C%0A%20%20%20%20%20%200)%0A%20%20%20)%2C%0A0)%3C%2FPRE%3E%3CP%3Ewhich%20finds%20the%20cost%20for%20the%20order%20for%20given%20Date%20and%20Make%20(A2%20and%20B2)%2C%20and%20Type%20for%20this%20column%20(C1).%26nbsp%3B%3C%2FP%3E%3CP%3ECopy%20this%20cell%20to%20the%20right%20till%20last%20column%20type%20(F2).%3C%2FP%3E%3CP%3ESelect%20cells%20from%20C2%20to%20F2%20and%20apply%20cusom%20format%20(Ctrl%2B1)%20to%20them%3C%2FP%3E%3CPRE%3E%5B%24%24-en-US%5D%23%2C%23%230.00%3B%3B%3B%40%3C%2FPRE%3E%3CP%3Ewhich%20'hides'%20zeroes%20in%20the%20cells.%3C%2FP%3E%3CP%3ENow%20select%20all%20cells%20in%20row%202%20and%20drag%20them%20down%20till%20out%20of%20your%20ordes%20in%20the%20month%2C%20better%20more.%20Finally%20select%20sheet%20tab%20and%20copy%20it%26nbsp%3Bfor%20another%20months.%20Only%20H1%20is%20enough%20to%20change%20for%20each%20given%20month.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20formulas%20above%20size%20of%20orders%20list%20could%20be%20defined%20dynamically%2C%20but%20bit%20easier%20if%20you%20use%20for%20orders%20Excel%20Table%20(that's%20only%20one%20of%20pros).%20Let%20name%20that%20table%20as%20Orders%2C%20when%20in%20monthly%20tabs%20alternatives%20to%20above%20formulas%20will%20be%3C%2FP%3E%3CPRE%3E%3DIFERROR(%0A%20%20%20INDEX(Orders%5B%5BOrder%20Date%5D%3A%5BMake%5D%5D%2C%0A%20%20%20%20%20%20SMALL(%0A%20%20%20%20%20%20%20%20%20IF((MONTH(Orders%5BOrder%20Date%5D)%3D%24H%241)*(Orders%5BOrder%20Date%5D%26gt%3B1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20ROW(Orders%5BOrder%20Date%5D)%20-%20ROW(Orders%5B%5B%23Headers%5D%2C%5BOrder%20Date%5D%5D)%0A%20%20%20%20%20%20%20%20%20)%2CROW(1%3A1)%0A%20%20%20%20%20%20)%2C1%0A%20%20%20)%2C%22%22%0A)%3C%2FPRE%3E%3CP%3Eand%3C%2FP%3E%3CPRE%3E%3DIFERROR(%0A%20%20%20INDEX(Orders%5BCost%5D%2C%0A%20%20%20%20%20%20MATCH(1%2C%0A%20%20%20%20%20%20%20%20%20(Orders%5BOrder%20Date%5D%3D%24A2)*%0A%20%20%20%20%20%20%20%20%20(Orders%5BMake%5D%3D%24B2)*%0A%20%20%20%20%20%20%20%20%20(Orders%5BType%5D%3DC%241)%2C%0A%20%20%20%20%20%200)%0A%20%20%20)%2C%0A0)%3C%2FPRE%3E%3CP%3EAnd%20finally%20the%20option%20with%20using%20Power%20Query%20(aka%20Get%20%26amp%3B%20Transform%20in%20Excel%202016).%20First%2C%20we%20load%20and%20pivot%20for%20types%20Orders%20table.%20Could%20be%20done%20in%20few%20clicks%20in%20user%20interface%2C%20here%20is%20code%20generated%3C%2FP%3E%3CPRE%3Elet%0A%20%20%20%20Source%20%3D%20Excel.CurrentWorkbook()%7B%5BName%3D%22Orders%22%5D%7D%5BContent%5D%2C%0A%20%20%20%20ChangeType%20%3D%20Table.TransformColumnTypes(Source%2C%7B%0A%20%20%20%20%20%20%7B%22Order%20Date%22%2C%20type%20date%7D%2C%0A%20%20%20%20%20%20%7B%22Type%22%2C%20type%20text%7D%2C%0A%20%20%20%20%20%20%7B%22Make%22%2C%20type%20text%7D%2C%0A%20%20%20%20%20%20%7B%22Model%22%2C%20type%20text%7D%2C%0A%20%20%20%20%20%20%7B%22Year%22%2C%20Int64.Type%7D%2C%0A%20%20%20%20%20%20%7B%22Cost%22%2C%20type%20number%7D%0A%20%20%20%20%7D)%2C%0A%20%20%20%20RemoveUnused%20%3D%20Table.RemoveColumns(ChangeType%2C%7B%22Model%22%2C%20%22Year%22%7D)%2C%0A%20%20%20%20ReordereColumns%20%3D%20Table.ReorderColumns(RemoveUnused%2C%0A%20%20%20%20%20%20%7B%22Order%20Date%22%2C%20%22Make%22%2C%20%22Type%22%2C%20%22Cost%22%7D%0A%20%20%20)%2C%0A%20%20%20%20PivotType%20%3D%20Table.Pivot(ReordereColumns%2C%0A%20%20%20%20%20%20List.Distinct(ReordereColumns%5BType%5D)%2C%20%22Type%22%2C%20%22Cost%22)%0Ain%0A%20%20%20%20PivotType%3C%2FPRE%3E%3CP%3ELoad%20the%20query%20as%20connection.%20After%20that%20make%20the%20reference%20on%20that%20query%20fro%20each%20month%20adding%20filter%20for%20the%20monh%3C%2FP%3E%3CPRE%3Elet%0A%20%20%20%20Source%20%3D%20Orders%2C%0A%20%20%20%20FilterMonth%20%3D%20Table.SelectRows(Source%2C%20each%20Date.Month(%5BOrder%20Date%5D)%20%3D%209)%0Ain%0A%20%20%20%20FilterMonth%3C%2FPRE%3E%3CP%3Eand%20load%20each%20of%20them%20into%20Excel%20sheet%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFileas%20are%20attached%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109708%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109708%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Rob%20Nunley%2C%3CBR%20%2F%3E%3CBR%20%2F%3EYour%20problem%20can%20be%20easily%20solved%20by%26nbsp%3Butilizing%20excel's%20Pivot%20Tables.%20I%20hope%20you%20are%20somehow%20well%20versed%20with%20excel's%20ribbon%20menu.%20here%20are%20the%20general%20steps%3A%3C%2FP%3E%3COL%3E%3CLI%3ECreate%20an%20Excel%20table%20with%20your%20order%20data.%3C%2FLI%3E%3CLI%3ECreate%20a%20month%20column%20using%20this%20formula%3A%20%22%3DTEXT(%5B%40%5BOrder%20Date%5D%5D%2C%22MMM%22)%22%3C%2FLI%3E%3CLI%3EUse%20the%20table%20as%20a%20source%20data%20for%20your%20pivot%20table.%3C%2FLI%3E%3CLI%3EDrag%20order%20date%20and%20make%20fields%20to%20the%20rows%20area.%3C%2FLI%3E%3CLI%3EDrag%20model%20to%20the%20coluns%20area.%3C%2FLI%3E%3CLI%3EDrag%20month%20to%20the%20filters%20area.%3C%2FLI%3E%3CLI%3EDrag%20Cost%20to%20the%20Values%20area.%3C%2FLI%3E%3CLI%3EFormat%20the%20pivot%20table%20to%20your%20liking.%3COL%3E%3CLI%3EClick%20the%20Sum%20of%20Cost%20and%20choose%20value%20field%20settings.%3C%2FLI%3E%3CLI%3EClick%20Number%20Format%20and%20choose%20Currency%20then%20click%20OK%2C%20and%20then%20OK%20again.%3C%2FLI%3E%3CLI%3EUnder%20the%20design%20tab%20Click%20Subtotals%20and%26nbsp%3Bchoose%20do%20not%20show%20subtotals.%3C%2FLI%3E%3CLI%3EClick%20Report%20Layout%20and%20choose%20show%20in%20tabular%20forms.%3C%2FLI%3E%3CLI%3EClick%20report%20layout%20and%20choose%20repeat%20all%20items%20labels.%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3CLI%3EGenerate%20the%20Sheets%20that%20you%20need.%3COL%3E%3CLI%3EUnder%20the%20analyze%20tab%2C%20click%20the%20little%20arrow%20beside%20the%20Options.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20267px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F20721i5A5A66F918997A8E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3EClick%20show%20report%20filter%20pages.%3C%2FLI%3E%3CLI%3EClick%20Month%20and%20then%20click%20OK.%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3CLI%3EYou're%20Done!%20if%20ever%20that%20you%20entered%20more%20data%20on%20your%20orders%20table%2C%20just%20click%20Refresh%20All%20under%20the%20Data%20tab%20and%20everything%20will%20be%20updated.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EI%20have%20attached%20the%20file%20which%20includes%20the%20sheets%20for%20Sep%20and%20Oct.%20In%20the%20case%20of%20another%20month%20(Let's%20Say%20Nov)%20you%20can%20do%20step%209%20again%2C%20just%20delete%20the%20duplicate%20sheets%20(Sep%20(2)%20and%20Oct%20(2)).%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI%20hope%20you%20can%20try%20out%20the%20steps%20and%20get%20familiar%20with%20Excel's%20capabilities.%20If%20you%20ever%20need%20more%20details%20on%20the%20step%2C%20I%20can%20update%20this%20post%20and%20add%20more%20screenshots.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGood%20luck%20on%20you%20task%2C%3C%2FP%3E%3CP%3EArgelo%20Royce%20Bautista%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-109692%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109692%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20reply.%26nbsp%3B%20Here%20is%20a%20sample%20workbook%20with%20the%20desired%20output.%26nbsp%3B%20The%20month%20sheets%20are%20link%20to%20the%20Orders%20sheet%20and%20auopopulates%20the%20corosponding%20columns.%26nbsp%3B%20The%20column%20headers%20on%20the%20Orders%20sheet%20are%20different%20from%20those%20on%20the%20month%20sheets.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%3E%3CTBODY%3E%3CTR%3E%3CTD%3EOrders%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3EOrder%20Date%3C%2FTD%3E%3CTD%3EType%3C%2FTD%3E%3CTD%3EMake%3C%2FTD%3E%3CTD%3EModel%3C%2FTD%3E%3CTD%3EYear%3C%2FTD%3E%3CTD%3ECost%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E9%2F12%2F2017%3C%2FTD%3E%3CTD%3ERV%3C%2FTD%3E%3CTD%3EChampion%3C%2FTD%3E%3CTD%3ETeir%201%3C%2FTD%3E%3CTD%3E2004%3C%2FTD%3E%3CTD%3E%2435%2C000.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E9%2F12%2F2017%3C%2FTD%3E%3CTD%3ECar%3C%2FTD%3E%3CTD%3EToyota%3C%2FTD%3E%3CTD%3ECamry%3C%2FTD%3E%3CTD%3E2007%3C%2FTD%3E%3CTD%3E%2418%2C000.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E9%2F12%2F2017%3C%2FTD%3E%3CTD%3ERV%3C%2FTD%3E%3CTD%3EWinnebago%3C%2FTD%3E%3CTD%3ETeir%202%3C%2FTD%3E%3CTD%3E2015%3C%2FTD%3E%3CTD%3E%2443%2C000.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E9%2F21%2F2017%3C%2FTD%3E%3CTD%3ETruck%3C%2FTD%3E%3CTD%3EFord%3C%2FTD%3E%3CTD%3EF150%3C%2FTD%3E%3CTD%3E2004%3C%2FTD%3E%3CTD%3E%2421%2C000.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E10%2F13%2F2017%3C%2FTD%3E%3CTD%3EBoat%3C%2FTD%3E%3CTD%3EWatercraft%3C%2FTD%3E%3CTD%3ESki%3C%2FTD%3E%3CTD%3E2009%3C%2FTD%3E%3CTD%3E%2412%2C000.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E10%2F16%2F2017%3C%2FTD%3E%3CTD%3ERV%3C%2FTD%3E%3CTD%3EWinnebago%3C%2FTD%3E%3CTD%3ETeir%202%3C%2FTD%3E%3CTD%3E2006%3C%2FTD%3E%3CTD%3E%2445%2C000.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E10%2F16%2F2017%3C%2FTD%3E%3CTD%3ECar%3C%2FTD%3E%3CTD%3EToyota%3C%2FTD%3E%3CTD%3ECorolla%3C%2FTD%3E%3CTD%3E2000%3C%2FTD%3E%3CTD%3E%248%2C500.00%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E10%2F17%2F2017%3C%2FTD%3E%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CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%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-109677%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-109677%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Rob%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsually%20what%20people%20do%20to%20recommending%20this%20or%20that%20formula%20they%20played%20with%20it%20in%20the%20workbook.%20Even%20if%20they%20know%20for%20sure%20how%20it%20works.%20If%20you%20provide%20short%20sample%20file%20not%20to%20generate%20your%20data%20model%20from%20scratch%20it'll%20be%20much%20more%20chances%20someone%20answers.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-437722%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%20Data%20to%20Other%20Sheets'%20Columns%20Based%20on%20Criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-437722%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EInline%20with%20the%20same%2C%20i%20have%20a%20data%20as%20attached%20in%20file%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20extract%20data%20for%20attributes%20column%20against%20each%20classs%20having%20only%20cross%20mark%20shown.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecan%20anyone%20please%20suggest%20the%20ways%20to%20doing%20it%3F.%20Thanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Rob Nunley
Occasional Contributor

I have one Orders sheet and 12 Month sheets (Jan, Feb, Mar, etc).  The Orders sheet has five columns: Dept, Vendor, Brand, Cost and Date.  The Dept column has ten different options ie Truck, Car, RV, Boat, etc.  The Orders sheet will have all the order data for an entire year.

 

The Month sheets have the same columns as the Orders sheet excluding the Dept and Cost columns. Instead of one column for Dept there are 10 columns, one for each of the options. These columns will be populated with the cost of each option.  This makes a total of 13 columns on the Month sheets.  Vendor, Brand and Date columns are A1:A3 and the Dept options columns are A4:13.

 

I would like to populate the Month sheets based on the Date column from the Orders sheet.  For example, all the orders between Jan 1 and Jan 31 would appear on the Jan sheet, all the orders from Feb 1 to Feb 28 on the Feb sheet and so on for the remaining Month sheets.  Depending on the option selected in the Dept column of the Orders sheet, I would like the associated cost to populate the corresponding options column on the Month sheet. For example, if on the Orders sheet an RV was entered at a cost of $35,000, that cost would be transferred to the Month sheet to the appropriate option column.  In this case the RV column. 

 

To sum up, each row in the Month sheets would have the Vendor, Brand, Date and Cost in the appropriate option column.  This data would be auto populated from the Orders sheet.

 

Is there a formula(s) that makes this possible?

 

Thanks in advance!

8 Replies

Hi Rob,

 

Usually what people do to recommending this or that formula they played with it in the workbook. Even if they know for sure how it works. If you provide short sample file not to generate your data model from scratch it'll be much more chances someone answers.

Thanks for the reply.  Here is a sample workbook with the desired output.  The month sheets are link to the Orders sheet and auopopulates the corosponding columns.  The column headers on the Orders sheet are different from those on the month sheets. 

 

Orders     
Order DateTypeMakeModelYearCost
      
9/12/2017RVChampionTeir 12004$35,000.00
9/12/2017CarToyotaCamry2007$18,000.00
9/12/2017RVWinnebagoTeir 22015$43,000.00
9/21/2017TruckFordF1502004$21,000.00
10/13/2017BoatWatercraftSki2009$12,000.00
10/16/2017RVWinnebagoTeir 22006$45,000.00
10/16/2017CarToyotaCorolla2000$8,500.00
10/17/2017TruckToyotaTundra2001$12,345.00
10/18/2017TruckFordF2502016$16,988.00

 

Sep     
Order DateMakeRVCarTruckBoat
      
9/12/2017Champion$35,000.00   
9/12/2017Toyota $18,000.00  
9/12/2017Winnebago$43,000.00   
9/21/2017Ford  $21,000.00 

 

Oct     
Order DateMakeRVCarTruckBoat
      
10/13/2017Watercraft   $12,000.00
10/16/2017Winnebago$45,000.00   
10/16/2017Toyota $8,500.00  
10/17/2017Toyota  $12,345.00 
10/18/2017Ford  $16,988.00 

 

 

 

Solution

Hello Rob Nunley,

Your problem can be easily solved by utilizing excel's Pivot Tables. I hope you are somehow well versed with excel's ribbon menu. here are the general steps:

  1. Create an Excel table with your order data.
  2. Create a month column using this formula: "=TEXT([@[Order Date]],"MMM")"
  3. Use the table as a source data for your pivot table.
  4. Drag order date and make fields to the rows area.
  5. Drag model to the coluns area.
  6. Drag month to the filters area.
  7. Drag Cost to the Values area.
  8. Format the pivot table to your liking.
    1. Click the Sum of Cost and choose value field settings.
    2. Click Number Format and choose Currency then click OK, and then OK again.
    3. Under the design tab Click Subtotals and choose do not show subtotals.
    4. Click Report Layout and choose show in tabular forms.
    5. Click report layout and choose repeat all items labels.
  9. Generate the Sheets that you need.
    1. Under the analyze tab, click the little arrow beside the Options.image.png
    2. Click show report filter pages.
    3. Click Month and then click OK.
  10. You're Done! if ever that you entered more data on your orders table, just click Refresh All under the Data tab and everything will be updated.

I have attached the file which includes the sheets for Sep and Oct. In the case of another month (Let's Say Nov) you can do step 9 again, just delete the duplicate sheets (Sep (2) and Oct (2)).


I hope you can try out the steps and get familiar with Excel's capabilities. If you ever need more details on the step, I can update this post and add more screenshots.

 

Good luck on you task,

Argelo Royce Bautista

Hi Rob,

 

In addition to PivotTable solution which Argelo suggested here are couple more. Which one to use depends on many factors, from Excel versions and do you use predefined forms or not; to personal preferences.

 

Anyway, first one using array formulas (Ctrl+Shift+Enter) to add. Let assume your data is located as

orders

Orders.JPG

month

Month.JPG

The pattern for the formula which extract data from master list based on criteria is described here http://www.exceltactics.com/make-filtered-list-sub-arrays-excel-using-small/4/ and in many other places.

In our case in monthly sheet in A2 let add

=IFERROR(
   INDEX(Orders!$A$2:$C$660,
      SMALL(
         IF((MONTH(Orders!$A$2:$A$660)=$H$1)*(Orders!$A$2:$A$660>1),
            ROW(Orders!$A$2:$A$660) - ROW(Orders!$A$2)+1
         ),ROW(1:1)
      ),1
   ),""
)

We take 660-rows range in Orders to have some gap. If fortunatelly you have more it is to be increased. Formula return first date in orders for defined in cell $H$1 month. Dates is first column in the range, in bold above in formula.

Copy this formula in B2 and change 1 on 3 to receive data from third column "Make".

To receive the cost by type for this record in C2 add

=IFERROR(
   INDEX(Orders!$F$2:$F$660,
      MATCH(1,
         (Orders!$A$2:$A$660=$A2)*
         (Orders!$C$2:$C$660=$B2)*
         (Orders!$B$2:$B$660=C$1),
      0)
   ),
0)

which finds the cost for the order for given Date and Make (A2 and B2), and Type for this column (C1). 

Copy this cell to the right till last column type (F2).

Select cells from C2 to F2 and apply cusom format (Ctrl+1) to them

[$$-en-US]#,##0.00;;;@

which 'hides' zeroes in the cells.

Now select all cells in row 2 and drag them down till out of your ordes in the month, better more. Finally select sheet tab and copy it for another months. Only H1 is enough to change for each given month.

 

In formulas above size of orders list could be defined dynamically, but bit easier if you use for orders Excel Table (that's only one of pros). Let name that table as Orders, when in monthly tabs alternatives to above formulas will be

=IFERROR(
   INDEX(Orders[[Order Date]:[Make]],
      SMALL(
         IF((MONTH(Orders[Order Date])=$H$1)*(Orders[Order Date]>1),
            ROW(Orders[Order Date]) - ROW(Orders[[#Headers],[Order Date]])
         ),ROW(1:1)
      ),1
   ),""
)

and

=IFERROR(
   INDEX(Orders[Cost],
      MATCH(1,
         (Orders[Order Date]=$A2)*
         (Orders[Make]=$B2)*
         (Orders[Type]=C$1),
      0)
   ),
0)

And finally the option with using Power Query (aka Get & Transform in Excel 2016). First, we load and pivot for types Orders table. Could be done in few clicks in user interface, here is code generated

let
    Source = Excel.CurrentWorkbook(){[Name="Orders"]}[Content],
    ChangeType = Table.TransformColumnTypes(Source,{
      {"Order Date", type date},
      {"Type", type text},
      {"Make", type text},
      {"Model", type text},
      {"Year", Int64.Type},
      {"Cost", type number}
    }),
    RemoveUnused = Table.RemoveColumns(ChangeType,{"Model", "Year"}),
    ReordereColumns = Table.ReorderColumns(RemoveUnused,
      {"Order Date", "Make", "Type", "Cost"}
   ),
    PivotType = Table.Pivot(ReordereColumns,
      List.Distinct(ReordereColumns[Type]), "Type", "Cost")
in
    PivotType

Load the query as connection. After that make the reference on that query fro each month adding filter for the monh

let
    Source = Orders,
    FilterMonth = Table.SelectRows(Source, each Date.Month([Order Date]) = 9)
in
    FilterMonth

and load each of them into Excel sheet

 

Fileas are attached

Thanks Argelo! Some months I will not have an RV in Orders sheet.  Is there a way to include a column for RV for those month on the pivot table?

Hi Rob,

Yes there is. 

  1. Click the dropdown ont he model field, and click field settings.
    image.png
  2. under the Layout & Print tab click show items with no data. Click okay and generate the Report Filter Pages again.
    image.png

Thank you for the help.  Works like a champ!

Hi

Inline with the same, i have a data as attached in file:

 

I need to extract data for attributes column against each classs having only cross mark shown.

 

can anyone please suggest the ways to doing it?. Thanks in advance.

Related Conversations
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
2 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies
*Updated 9/3* Syncing in Microsoft Edge Preview Channels
Elliot Kirk in Articles on
202 Replies