Auto fill columns across an Excel table

%3CLINGO-SUB%20id%3D%22lingo-sub-1582432%22%20slang%3D%22en-US%22%3EAuto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582432%22%20slang%3D%22en-US%22%3E%3CDIV%3EGood%20afternoon%2C%3C%2FDIV%3E%3CDIV%3EI%20need%20to%20fill%20in%20the%20Document%20ID%20columns%20in%20a%20table%20so%20that%20each%20Tag%20Term%20has%20a%20Document%20ID%20associated%20with%20it.%20The%20Document%20IDs%20should%20only%20fill%20in%20where%20there%20is%20a%20corresponding%20Term%20Tag%20in%20the%20column%20to%20the%20right%20of%20it.%20The%20table%20has%202000%20paired%20columns%2C%20so%20can%20someone%20tell%20me%20how%20I%20can%20do%20that%20automatically%20-%20like%20with%20a%20macro%20for%20example%3F%20The%20Starting%20Table%20sample%20is%20what%20the%20table%20looks%20like%20now.%20The%20Finished%20Table%20sample%20is%20how%20I%20want%20the%20table%20to%20be%20filled%20in.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ESTARTING%20TABLE%20SAMPLE%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CTABLE%20border%3D%220%22%20width%3D%22720%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2288%22%20height%3D%2219%22%3EDocument%20ID%3C%2FTD%3E%3CTD%20width%3D%22185%22%3ETerm%20tag%3C%2FTD%3E%3CTD%20width%3D%2286%22%3EDocument%20ID%3C%2FTD%3E%3CTD%20width%3D%22142%22%3ETerm%20tag%3C%2FTD%3E%3CTD%20width%3D%2288%22%3EDocument%20ID%3C%2FTD%3E%3CTD%20width%3D%22131%22%3ETerm%20tag%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E145436%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E145441%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E145461%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2238%22%3E%26nbsp%3B%3C%2FTD%3E%3CTD%20width%3D%22185%22%3ENational%20Criminal%20Justice%20Reference%20Service%20(NCJRS)%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3EStudents%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3EFellowship%20Programs%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3EGrants.gov%20(website)%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3EGrants.gov%20(website)%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3ETechnical%20assistance%20(TA)%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3EFellowship%20Programs%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3EForensic%20sciences%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%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3Exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%3C%2FDIV%3E%3CDIV%3EFINISHED%20TABLE%20SAMPLE%3C%2FDIV%3E%3CDIV%3E%3CTABLE%20border%3D%220%22%20width%3D%22650%22%20cellspacing%3D%220%22%20cellpadding%3D%220%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2295%22%20height%3D%2238%22%3EDocument%20ID%3C%2FTD%3E%3CTD%20width%3D%22184%22%3ETerm%20tag%3C%2FTD%3E%3CTD%20width%3D%2289%22%3EDocument%20ID%3C%2FTD%3E%3CTD%20width%3D%22128%22%3ETerm%20tag%3C%2FTD%3E%3CTD%20width%3D%2290%22%3EDocument%20ID%3C%2FTD%3E%3CTD%20width%3D%2264%22%3ETerm%20tag%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E145436%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E145441%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E145461%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2244%22%3E145436%3C%2FTD%3E%3CTD%20width%3D%22184%22%3ENational%20Criminal%20Justice%20Reference%20Service%20(NCJRS)%3C%2FTD%3E%3CTD%3E145441%3C%2FTD%3E%3CTD%3EStudents%3C%2FTD%3E%3CTD%3E145461%3C%2FTD%3E%3CTD%3EFellowship%20Programs%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E145436%3C%2FTD%3E%3CTD%3EGrants.gov%20(website)%3C%2FTD%3E%3CTD%3E145441%3C%2FTD%3E%3CTD%3EGrants.gov%20(website)%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E145436%3C%2FTD%3E%3CTD%3ETechnical%20assistance%20(TA)%3C%2FTD%3E%3CTD%3E145441%3C%2FTD%3E%3CTD%3EFellowship%20Programs%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20height%3D%2219%22%3E145436%3C%2FTD%3E%3CTD%3EForensic%20sciences%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%3C%2FTBODY%3E%3C%2FTABLE%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThanks%20in%20advance.%3C%2FDIV%3E%3CDIV%3ERegards%2C%3C%2FDIV%3E%3CDIV%3EJMarshall%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1582432%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1582507%22%20slang%3D%22en-US%22%3ERe%3A%20Auto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582507%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756292%22%20target%3D%22_blank%22%3E%40JMarshall325%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20that%20you%20see%20in%20the%20formula%20bar%20here%20will%20do%20it--just%20copy%20down%2C%20to%20however%20many%20rows%20the%20max%20would%20be%2C%20and%20then%20copy%2Fpaste%20those%20cells%20to%20the%20alternating%20columns%20the%20rest%20of%20the%20way%20across%20your%202000%20columns.%20That's%20how%20I%20did%20it%20in%20the%20file%20I%20created%20to%20demonstrate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20figure%20a%20half-second%20for%20each%20copy%2Fpaste%20and%20that%20would%20take%20just%20over%208%20minutes.%20It%20would%20probably%20take%20longer%20to%20write%20and%20execute%20a%20macro.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mathetes_0-1597170501131.png%22%20style%3D%22width%3A%20709px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F211839i134E8E727D8C4E81%2Fimage-dimensions%2F709x296%3Fv%3D1.0%22%20width%3D%22709%22%20height%3D%22296%22%20title%3D%22mathetes_0-1597170501131.png%22%20alt%3D%22mathetes_0-1597170501131.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1582607%22%20slang%3D%22en-US%22%3ERe%3A%20Auto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1582607%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20speedy%20reply.%20One%20more%20question%20-%20how%20would%20you%20repeat%20the%20formula%20to%20repeat%20the%20action.%3C%2FP%3E%3CP%3EWould%20it%20be%20like%20so%20the%20following%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3DIF(B3%26lt%3B%26gt%3B%22%22%2CA2%2C%22%22)%2C(D3%26lt%3B%26gt%3B%22%22%2CC2%2C%22%22)%2C(F3%26lt%3B%26gt%3B%22%22%2CE2%2C%22%22)%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EJMarshall%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1583115%22%20slang%3D%22en-US%22%3ERe%3A%20Auto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1583115%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756292%22%20target%3D%22_blank%22%3E%40JMarshall325%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDid%20you%20try%20copy%20and%20paste%3F%26nbsp%3B%20I'm%20going%20to%20make%20an%20assumption%20here%2C%20based%20on%20the%20question%3A%20you%20seem%20to%20be%20very%20much%20a%20beginner%20with%20Excel%2C%20and%20maybe%20even%20not%20confident%20with%20computers.%20So%20without%20wanting%20to%20be%20too%20basic%2C%20I'm%20going%20to%20spell%20out%20steps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%20of%20all%2C%20you%20can%20copy%20and%20paste%20from%20the%20initial%20cell%20(ie.%2C%20copy%20A3)%20and%20then%20highlight%20the%20cells%20below%20it%2C%20as%20far%20as%20you%20want%20to%20go%2C%20and%20do%20a%20%22paste.%22%20The%20formula%20will%20automatically%20adjust%20the%20references%20because%20I%20used%20relative%2C%20not%20absolute%2C%20references.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20the%20same%20is%20true%20when%20you%20copy%20to%20cell%20C3%20and%20the%20cells%20below%20that.%20You%20do%20not%20need%20to%20re-write%20the%20formula.%20Copy%20it%20and%20paste%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20even%20better%2C%20you%20can%20use%20keyboard%20short-cuts%20CTRL%2BC%20to%20copy%2C%20CTRL%2BV%20to%20paste.%20Or%2C%20if%20you're%20in%20a%20Mac%20(as%20I%20am)%20Command%2BC%20to%20copy%2C%20Command%2BV%20to%20paste.%20And%20you%20can%20copy%20all%20of%20the%20range%20A3%3AA10%20or%20whatever%20to%20C3%3AC10...%26nbsp%3B%26nbsp%3B%20Those%20keyboard%20short-cuts%20are%20what%20I%20was%20assuming%20would%20be%20used%20when%20I%20said%20it%20would%20go%20quickly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EPostscript%3A%20I%20apologize%20for%20not%20including%20the%20spreadsheet%20itself.%20I%20didn't%20even%20save%20it%20because%20I%20thought%20those%20copy%20and%20paste%20steps%20were%20so%20basic%20that%20you'd%20know%20how%20to%20proceed.%20I%20could%20re-create%20it%20if%20you%20need%20that%20level%20of%20assistance.%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1585702%22%20slang%3D%22en-US%22%3ERe%3A%20Auto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1585702%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20clarification.%20I've%20worked%20with%20Excel%20quite%20a%20bit%2C%20but%20I'm%20self-taught%2C%20so%20I%20have%20a%20lot%20of%20gaps%20in%20my%20knowledge%2C%20particularly%20with%20regards%20to%20writing%20formulas%20and%20code.%20I%20was%20not%20aware%20that%20the%20formula%20that%20you%20sent%20had%20relative%20references%20rather%20than%20the%20absolute%20reference.%3C%2FP%3E%3CP%3EI%20would%20still%20like%20to%20figure%20out%20how%20to%20replicate%20the%20action%20across%20the%20entire%20spreadsheet%20rather%20than%20manually%20copying%20and%20pasting.%3C%2FP%3E%3CP%3E8%20minutes%20is%20not%20a%20lot%20of%20time%2C%20but%20I'm%20very%20likely%20going%20to%20have%20more%20of%20the%20spreadsheets%20to%20work%20with%20so%20I'm%20trying%20to%20automate%20as%20much%20as%20I%20can.%3C%2FP%3E%3CP%3EThanks%20very%20much%20for%20your%20suggestions%20-%20they%20will%20be%20a%20big%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1585763%22%20slang%3D%22en-US%22%3ERe%3A%20Auto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1585763%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756292%22%20target%3D%22_blank%22%3E%40JMarshall325%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wish%20I%20could%20help%20more.%20I%20don't%20write%20macros%20myself%3B%20am%20something%20of%20a%20cynic%20with%20regard%20to%20them%20(although%20I%20know%20that%20there%20are%20times%20when%20they%20can%20be%20very%20useful)....I%20just%20have%20the%20experience%20that%20Excel%20generally%20has%20the%20ability%20to%20do%20a%20lot%20of%20things%20with%20its%20built-in%20functions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20just%20now%20to%20record%20the%20macro%20copying%20cells%20two%20columns%20to%20the%20right%2C%20but%20can't%20get%20it%20to%20do%20that%20%22generically%22...%20so%20it%20would%20definitely%20take%20me%20more%20than%20the%20eight%20minutes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20say%20you're%20likely%20to%20have%20more%20of%20these%20spreadsheets%20to%20work%20with%20I%20find%20myself%20wondering%20if%20there's%20something%20you%20can%20do%20to%20alter%20the%20way%20they%20come%20to%20you.%20It%20would%20be%20a%20LOT%20easier%20to%20create%20the%20kind%20of%20relationship%20you're%20creating%20if%20it%20all%20came%20organized%20in%20two%20parallel%20columns%20rather%20than%20spread%20across%202000%20columns.%26nbsp%3B%20Is%20it%20possible%20to%20do%20something%20to%20preclude%20the%20need%20to%20do%20this%20in%20the%20first%20place%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1586770%22%20slang%3D%22en-US%22%3ERe%3A%20Auto%20fill%20columns%20across%20an%20Excel%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1586770%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756292%22%20target%3D%22_blank%22%3E%40JMarshall325%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20I%20probe%20a%20bit%20more%20here%20into%20how%20you've%20used%20Excel%2C%20or%20maybe%20more%20precisely%2C%20toward%20what%20ends.%20This%20little%20snippet%20of%20the%20spreadsheet%20you%20posted%20in%20requesting%20help%20appears%20to%20be%20something%20from%20the%20academic%20realm.%20It%20also%20could%20just%20be%20the%20tip%20of%20an%20iceberg--and%20maybe%20this%20is%20what%20you're%20alluding%20to%20in%20saying%20you%20expect%20you're%20%22likely%20going%20to%20have%20more%20of%20the%20spreadsheets%20to%20work%20with%20so...%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20ask%20because%2C%20although%20the%20heading%20for%20this%20whole%20thread%20refers%20to%20%22columns%20across%20an%20Excel%20table%2C%22%20it's%20NOT%20actually%20an%20Excel%20Table.%20In%20an%20Excel%20Table%2C%20all%20of%20that%20would%20have%20been%20arrayed%20thus%2C%20and%20could%20form%20the%20content%20on%20a%20database%20%22tab%22%20as%20I've%20done%20in%20the%20attached%20demo%20file%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mathetes_0-1597323158472.png%22%20style%3D%22width%3A%20521px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212218i583697CDAA850E10%2Fimage-dimensions%2F521x265%3Fv%3D1.0%22%20width%3D%22521%22%20height%3D%22265%22%20title%3D%22mathetes_0-1597323158472.png%22%20alt%3D%22mathetes_0-1597323158472.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EFrom%20that%20as%20the%20source%20database%2C%20you%20could%20develop%20an%20extraction%20protocol--and%20this%20is%20just%20a%20demonstration--where%20the%20simple%20selection%20of%20an%20ID%20(from%20a%20list%20of%20unique%20IDs%20generated%20from%20the%20database%20itself)%20would%20immediately%20display%20all%20the%20information%20associated%20with%20that%20ID.%20As%20shown%20below%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mathetes_1-1597323329246.png%22%20style%3D%22width%3A%20569px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212219i1654B3357A0FC5F8%2Fimage-dimensions%2F569x425%3Fv%3D1.0%22%20width%3D%22569%22%20height%3D%22425%22%20title%3D%22mathetes_1-1597323329246.png%22%20alt%3D%22mathetes_1-1597323329246.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20data%20extracted%20here%20is%20all%20of%20what's%20available%3B%20were%20that%20database%20to%20be%20extended%2C%20it%20could%20show%20much%2C%20much%20more.%20Depending%20on%20the%20nature%20of%20your%20data%2C%20stats%2C%20activities%2C%20etc.%2C%20there%20are%20data%20extraction%20tools%20available%20(e.g.%2C%20the%20Pivot%20Table)%20for%20cross-tabulated%20reports%20and%20graphs....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20word%20of%20warning%3A%20this%20demonstration%20spreadsheet%20uses%20the%20most%20recent%20release%20of%20Excel%20and%20two%20functions%20available%20in%20it%20to%20all%20users%20who%20have%20it%20(I'm%20not%20an%20%22insider%22%20with%20beta%20access%20to%20features%20still%20under%20development)...those%20being%20the%20functions%20UNIQUE%20and%20FILTER%20in%20this%20case.%20So%20if%20your%20display%20does%20not%20work%20in%20all%20respects%2C%20it%20would%20be%20because%20you%20are%20still%20working%20with%20an%20older%20version%20of%20Excel.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%20I%20am%20showing%20you%20this%20because%20I%20am%20inferring%20from%20what%20you've%20read%20that%20(just%20as%20I%20discovered%20some%20of%20the%20holes%20in%20my%20own%20grasp%20of%20Excel's%20features%20in%20coming%20to%20this%20board%20after%20having%20retired%20nearly%20twenty%20years%20ago)....I%20suspect%20you%20may%20have%20been%20using%20Excel%20at%20a%20level%20far%20below%20its%20capabilities%20to%20help%20you%20in%20your%20research%20(%3F)%20or%20work%2C%20whatever%20it%20is.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20why%2C%20if%20you%20could%20get%20that%20original%20data%20organized%20as%20a%20genuine%20table%2C%20you'd%20be%20on%20the%20verge%20of%20unlocking%20some%20of%20the%20real%20powers%20of%20Excel%20to%20help%20you%20%22mine%20the%20data.%22%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor
Good afternoon,
I need to fill in the Document ID columns in a table so that each Tag Term has a Document ID associated with it. The Document IDs should only fill in where there is a corresponding Term Tag in the column to the right of it. The table has 2000 paired columns, so can someone tell me how I can do that automatically - like with a macro for example? The Starting Table sample is what the table looks like now. The Finished Table sample is how I want the table to be filled in.
 
STARTING TABLE SAMPLE
 
Document IDTerm tagDocument IDTerm tagDocument IDTerm tag
145436 145441 145461 
 National Criminal Justice Reference Service (NCJRS) Students Fellowship Programs
 Grants.gov (website) Grants.gov (website)  
 Technical assistance (TA) Fellowship Programs  
 Forensic sciences    
 
 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
FINISHED TABLE SAMPLE
Document IDTerm tagDocument IDTerm tagDocument IDTerm tag
145436 145441 145461 
145436National Criminal Justice Reference Service (NCJRS)145441Students145461Fellowship Programs
145436Grants.gov (website)145441Grants.gov (website)  
145436Technical assistance (TA)145441Fellowship Programs  
145436Forensic sciences    
 
 
Thanks in advance.
Regards,
JMarshall
 

 

6 Replies

@JMarshall325 

 

The formula that you see in the formula bar here will do it--just copy down, to however many rows the max would be, and then copy/paste those cells to the alternating columns the rest of the way across your 2000 columns. That's how I did it in the file I created to demonstrate.

 

I figure a half-second for each copy/paste and that would take just over 8 minutes. It would probably take longer to write and execute a macro.

mathetes_0-1597170501131.png

 

@mathetes 

Thanks for your speedy reply. One more question - how would you repeat the formula to repeat the action.

Would it be like so the following?

 

         =IF(B3<>"",A2,""),(D3<>"",C2,""),(F3<>"",E2,"")    

 

Regards,

JMarshall

@JMarshall325 

 

Did you try copy and paste?  I'm going to make an assumption here, based on the question: you seem to be very much a beginner with Excel, and maybe even not confident with computers. So without wanting to be too basic, I'm going to spell out steps.

 

First of all, you can copy and paste from the initial cell (ie., copy A3) and then highlight the cells below it, as far as you want to go, and do a "paste." The formula will automatically adjust the references because I used relative, not absolute, references.

 

And the same is true when you copy to cell C3 and the cells below that. You do not need to re-write the formula. Copy it and paste it.

 

And even better, you can use keyboard short-cuts CTRL+C to copy, CTRL+V to paste. Or, if you're in a Mac (as I am) Command+C to copy, Command+V to paste. And you can copy all of the range A3:A10 or whatever to C3:C10...   Those keyboard short-cuts are what I was assuming would be used when I said it would go quickly.

 

Postscript: I apologize for not including the spreadsheet itself. I didn't even save it because I thought those copy and paste steps were so basic that you'd know how to proceed. I could re-create it if you need that level of assistance.

@mathetes 

Thanks for the clarification. I've worked with Excel quite a bit, but I'm self-taught, so I have a lot of gaps in my knowledge, particularly with regards to writing formulas and code. I was not aware that the formula that you sent had relative references rather than the absolute reference.

I would still like to figure out how to replicate the action across the entire spreadsheet rather than manually copying and pasting.

8 minutes is not a lot of time, but I'm very likely going to have more of the spreadsheets to work with so I'm trying to automate as much as I can.

Thanks very much for your suggestions - they will be a big help.

@JMarshall325 

 

I wish I could help more. I don't write macros myself; am something of a cynic with regard to them (although I know that there are times when they can be very useful)....I just have the experience that Excel generally has the ability to do a lot of things with its built-in functions.

 

I tried just now to record the macro copying cells two columns to the right, but can't get it to do that "generically"... so it would definitely take me more than the eight minutes.

 

When you say you're likely to have more of these spreadsheets to work with I find myself wondering if there's something you can do to alter the way they come to you. It would be a LOT easier to create the kind of relationship you're creating if it all came organized in two parallel columns rather than spread across 2000 columns.  Is it possible to do something to preclude the need to do this in the first place?

@JMarshall325 

 

Can I probe a bit more here into how you've used Excel, or maybe more precisely, toward what ends. This little snippet of the spreadsheet you posted in requesting help appears to be something from the academic realm. It also could just be the tip of an iceberg--and maybe this is what you're alluding to in saying you expect you're "likely going to have more of the spreadsheets to work with so..."

 

I ask because, although the heading for this whole thread refers to "columns across an Excel table," it's NOT actually an Excel Table. In an Excel Table, all of that would have been arrayed thus, and could form the content on a database "tab" as I've done in the attached demo file:

mathetes_0-1597323158472.png

From that as the source database, you could develop an extraction protocol--and this is just a demonstration--where the simple selection of an ID (from a list of unique IDs generated from the database itself) would immediately display all the information associated with that ID. As shown below:

mathetes_1-1597323329246.png

The data extracted here is all of what's available; were that database to be extended, it could show much, much more. Depending on the nature of your data, stats, activities, etc., there are data extraction tools available (e.g., the Pivot Table) for cross-tabulated reports and graphs....

 

A word of warning: this demonstration spreadsheet uses the most recent release of Excel and two functions available in it to all users who have it (I'm not an "insider" with beta access to features still under development)...those being the functions UNIQUE and FILTER in this case. So if your display does not work in all respects, it would be because you are still working with an older version of Excel.

 

Anyway, I am showing you this because I am inferring from what you've read that (just as I discovered some of the holes in my own grasp of Excel's features in coming to this board after having retired nearly twenty years ago)....I suspect you may have been using Excel at a level far below its capabilities to help you in your research (?) or work, whatever it is.

 

It's why, if you could get that original data organized as a genuine table, you'd be on the verge of unlocking some of the real powers of Excel to help you "mine the data."