SOLVED
Home

Formulas to add info to cell based on a WORD in another cell

%3CLINGO-SUB%20id%3D%22lingo-sub-877181%22%20slang%3D%22en-US%22%3EFormulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877181%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20looking%20to%20get%20a%20cell%20to%20add%20information%20based%20on%20another%20cell%2C%20and%20can't%20seem%20to%20get%20it...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBasically%2C%20what%20I%20want%20to%20do%20is%20have%20a%20cell%20look%20at%20another%2C%20and%20based%20on%20a%20specific%20word%2C%20add%20specific%20information.%20For%20example%3A%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'MB'%20in%20it%2C%20then%20it%20should%20add%20'192.104.'%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'SK'%20in%20it%2C%20then%20it%20should%20add%20'192.103.'%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'AB'%20in%20it%2C%20then%20it%20should%20add%20'192.102.'%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'BC'%20in%20it%2C%20then%20it%20should%20add%20'192.101.'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20some%20IF%20statements%2C%20and%20they%20hit%20up%20the%20%23NAME%3F%20instead.%20I've%20even%20tried%20to%20get%20it%20to%20look%20ONLY%20at%20one%2C%20and%20add%20in%20one%20set.%20Here's%20what%20I've%20tried%3A%3C%2FP%3E%3CP%3E%3DIF(A2%3AA500%3DMB%2C%22192.104.%22%2CIF(A2%3AA500%3DAB%2C%22192.102.%22%2CIF(A2%3AA500%3DSK%2C%22192.103.%22%2CIF(A2%3AA500%3DBC%2C%22192.101.%22%2C%20%22ERROR%22))))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20something%20I%20am%20missing%2C%20or%20a%20better%20way%20to%20get%20the%20information%20I%20want%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEventually%2C%20I'm%20also%20looking%20to%20have%20it%20query%20previous%20cells%20for%20the%20last%20part%20and%20add%20in%20the%20next.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20even%20possible%20in%20Excel%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-877181%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-877239%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877239%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380407%22%20target%3D%22_blank%22%3E%40RandyD79%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20would%20be%20much%20easier%20to%20visualize%20what%20exactly%20you%20are%20trying%20to%20achieve%20if%20you%20upload%20a%20small%20sample%20file%20along%20with%20the%20desired%20output%20mocked%20up%20manually%20and%20an%20explanation%20which%20justify%20your%20desired%20output%20in%20the%20next%20column%20for%20few%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBtw%20%23NAME%3F%20error%20simply%20means%20that%20Excel%20doesn't%20recognize%20the%20formula%20you%20are%20using%20or%20an%20incorrect%20formula%20e.g.%20in%20your%20formula%20you%20need%20to%20surround%20the%20words%20with%20double%20quotes%20like%20%22MB%22%2C%20%22AB%22%20etc.%3C%2FP%3E%3CP%3EAnd%20if%20you%20miss%20those%20double%20quotes%20Excel%20assumes%20MB%2C%20AB%20etc%20are%20some%20functions%20which%20it%20doesn't%20recognize%20and%20produces%20that%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877297%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877297%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20reply!%3C%2FP%3E%3CP%3EBasically%2C%20this%20is%20what%20it%20would%20look%20like%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20719px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F133635i2E7420A0039DB181%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22excel.jpg%22%20title%3D%22excel.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ECell%20A%20has%20a%20list%20of%20Province%20Acronyms%2C%20Cells%20B%20through%20E%20don't%20mean%20anything%20to%20this%20cell%20(They're%20their%20own%20thing.%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20building%20out%20hundreds%20of%20these%20things%2C%20and%20they%20have%20IP%20addresses%20based%20on%20their%20province%2C%20and%20eventually%2C%20there%20may%20be%20other's%20that%20will%20build%20as%20well%2C%20and%20we%20need%20to%20know%20what%20addresses%20we%20are%20using%20so%20that%20there's%20no%20errors%20or%20overlap.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBasically%2C%20the%20cells%20in%20F%20should%20look%20to%20see%20what%20acronym%20is%20in%20cell%20A%2C%20and%20add%20in%20the%20correct%20first%20half%20of%20the%20IP%20range.%20The%20F%20column%20will%20eventually%20be%20hidden%2C%20and%20the%20last%20half%20will%20be%20added%20in%20manually%20based%20on%20the%20previous%20ranges%20for%20that%20same%20province%2C%20producing%20the%20full%20IP%20address.%20Similar%20things%20will%20occur%20for%20an%20additional%20five%20IP's%20per%20device%20based%20on%20other%20factors%20that%20will%20grab%20from%20F%20column%20and%20others.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877329%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877329%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380407%22%20target%3D%22_blank%22%3E%40RandyD79%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20image%2C%20though%20images%20are%20not%20very%20helpful%20and%20difficult%20to%20work%20with.%3C%2FP%3E%3CP%3EI%20requested%20you%20to%20upload%20a%20sample%20Excel%20file%20not%20the%20image%20along%20with%20the%20desired%20output%20mocked%20up%20manually.%20Please%20do%20so%20if%20possible.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877356%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877356%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAhh%20okay.%20Here%20is%20basically%20what%20I%20am%20doing.%20I%20have%20a%20section%20highlighted%20in%20green%20that%20is%20what%20I'll%20be%20slowly%20building%20in%20to%20get%20our%20finished%20products%20and%20all%20the%20info.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877402%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877402%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380407%22%20target%3D%22_blank%22%3E%40RandyD79%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20sample%20file.%3C%2FP%3E%3CP%3EIt%20is%20still%20not%20clear%20to%20me%20that%20which%20column%20you%20want%20to%20populate%20with%20the%20formula%20depending%20on%20the%20province%20in%20column%20A.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20read%20your%20original%20description%20which%20is%20as%20below...%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'MB'%20in%20it%2C%20then%20it%20should%20add%20'192.104.'%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'SK'%20in%20it%2C%20then%20it%20should%20add%20'192.103.'%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'AB'%20in%20it%2C%20then%20it%20should%20add%20'192.102.'%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'BC'%20in%20it%2C%20then%20it%20should%20add%20'192.101.'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20I%20understand%20is%2C%20the%20formula%20should%20look%20at%20the%20province%20in%20column%20A%20and%20add%20the%20network%20path%20(e.g.%20if%20province%20is%20MB%2C%20add%20192.104.)%20but%20the%20question%20is%2C%20add%20192.104.%20to%20what%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20explain%20your%20desired%20output%20for%20the%20first%20row%20and%20let%20me%20know%20if%20the%20province%20in%20A2%20is%20AB%20and%20F2%20is%20192.102.%2C%20which%20column%20you%20would%20be%20populating%20based%20on%20these%20two%20values%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20how%20many%20provinces%20you%20may%20have%20in%20column%20A%3F%20It%20would%20be%20easy%20to%20construct%20the%20formula%20if%20you%20create%20a%20Lookup%20table%20somewhere%20on%20the%20sheet%20or%20on%20another%20sheet%20to%20get%20what%20network%20path%20you%20need%20to%20add%20as%20per%20the%20province%20present%20in%20column%20A%20to%20avoid%20a%20long%20nesting%20IF%20formula.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOR%3C%2FP%3E%3CP%3EYou%20want%20to%20populate%20the%20column%20F%20based%20on%20the%20province%20in%20column%20A%3F%3C%2FP%3E%3CP%3Ee.g.%3C%2FP%3E%3CP%3EIf%20cell%20A2%20has%20the%20word%20'AB'%20in%20it%2C%20then%20populate%20F2%20with%20192.102.%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877424%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877424%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%2C%20So%20column%20%3CSTRONG%3EF%3C%2FSTRONG%3E%20should%20be%20blank%20until%20a%20province%20is%20added%20into%20column%20%3CSTRONG%3EA%3C%2FSTRONG%3E.%20There's%20only%20four%20provinces%20that%20I'm%20doing%20this%20for.%20No%20idea%20if%20we'll%20ever%20expand%20into%20more%20or%20not.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EColumn%20G%20and%20H%20are%20literally%20a%20drag%20down%20to%20get%20the%20next%20corresponding%20numbers.%20No%20formulas%20required.%3C%2FP%3E%3CP%3EColumns%20%3CSTRONG%3EI%3C%2FSTRONG%3E%2C%3CSTRONG%3E%20J%3C%2FSTRONG%3E%20and%3CSTRONG%3E%20K%3C%2FSTRONG%3E%20are%20all%20based%20on%20the%20information%20in%20column%20%3CSTRONG%3EF%3C%2FSTRONG%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-877527%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877527%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380407%22%20target%3D%22_blank%22%3E%40RandyD79%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20if%20all%20you%20need%20is%20to%20populate%20the%20column%20F%20based%20on%20province%20entered%20in%20column%20A%2C%20you%20may%20try%20something%20like%20this...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20F2%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIF(A2%3D%22%22%2C%22%22%2CIFERROR(VLOOKUP(A2%2CSubnet%2C2%2C0)%2C%22%22))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20inserted%20a%20new%20sheet%20called%20%22Lookup%22%20where%20you%20can%20list%20all%20the%20provinces%20and%20their%20subnet.%3C%2FP%3E%3CP%3EI%20have%20also%20created%20a%20dynamic%20Named%20Range%20called%20%22Subnet%22%20which%20is%20used%20in%20the%20formula%20above.%3C%2FP%3E%3CP%3EYou%20may%20add%20more%20provinces%20and%20their%20details%20on%20Lookup%20Sheet%20and%20your%20formula%20will%20be%20updated%20automatically%20as%20per%20the%20province%20you%20enter%20in%20column%20A%20if%20that%20province%20exists%20on%20Lookup%20Sheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20if%20A2%20is%20AB%2C%20the%20formula%20will%20return%20192.102.%20in%20F2.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20if%20you%20want%20F2%20to%20return%20192.102.1.0%20in%20F2%20as%20you%20showed%20in%20the%20cell%20F8%20(green%20cell)%2C%20you%20may%20tweak%20the%20formula%20as...%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIF(A8%3D%22%22%2C%22%22%2CIFERROR(VLOOKUP(A8%2CSubnet%2C2%2C0)%26amp%3B%221.0%22%2C%22%22))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877548%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877548%22%20slang%3D%22en-US%22%3EFascinating!%20Thank%20you%20very%20much!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-877559%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20to%20add%20info%20to%20cell%20based%20on%20a%20WORD%20in%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-877559%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380407%22%20target%3D%22_blank%22%3E%40RandyD79%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou're%20welcome!%20Glad%20it%20worked%20as%20desired.%3C%2FP%3E%3CP%3EThanks%20for%20the%20feedback!%3C%2FP%3E%3C%2FLINGO-BODY%3E
RandyD79
Occasional Contributor

I'm looking to get a cell to add information based on another cell, and can't seem to get it...

 

Basically, what I want to do is have a cell look at another, and based on a specific word, add specific information. For example:

If cell A2 has the word 'MB' in it, then it should add '192.104.'

If cell A2 has the word 'SK' in it, then it should add '192.103.'

If cell A2 has the word 'AB' in it, then it should add '192.102.'

If cell A2 has the word 'BC' in it, then it should add '192.101.'

 

I've tried some IF statements, and they hit up the #NAME? instead. I've even tried to get it to look ONLY at one, and add in one set. Here's what I've tried:

=IF(A2:A500=MB,"192.104.",IF(A2:A500=AB,"192.102.",IF(A2:A500=SK,"192.103.",IF(A2:A500=BC,"192.101.", "ERROR"))))

 

Is there something I am missing, or a better way to get the information I want?

 

Eventually, I'm also looking to have it query previous cells for the last part and add in the next.

 

Is this even possible in Excel?

 

9 Replies

@RandyD79 

It would be much easier to visualize what exactly you are trying to achieve if you upload a small sample file along with the desired output mocked up manually and an explanation which justify your desired output in the next column for few rows.

 

Btw #NAME? error simply means that Excel doesn't recognize the formula you are using or an incorrect formula e.g. in your formula you need to surround the words with double quotes like "MB", "AB" etc.

And if you miss those double quotes Excel assumes MB, AB etc are some functions which it doesn't recognize and produces that error.

@Subodh_Tiwari_sktneer 

 

Thanks for the reply!

Basically, this is what it would look like:

excel.jpg

Cell A has a list of Province Acronyms, Cells B through E don't mean anything to this cell (They're their own thing. 

I'm building out hundreds of these things, and they have IP addresses based on their province, and eventually, there may be other's that will build as well, and we need to know what addresses we are using so that there's no errors or overlap.

 

Basically, the cells in F should look to see what acronym is in cell A, and add in the correct first half of the IP range. The F column will eventually be hidden, and the last half will be added in manually based on the previous ranges for that same province, producing the full IP address. Similar things will occur for an additional five IP's per device based on other factors that will grab from F column and others.

@RandyD79 

Thanks for the image, though images are not very helpful and difficult to work with.

I requested you to upload a sample Excel file not the image along with the desired output mocked up manually. Please do so if possible.

@Subodh_Tiwari_sktneer 

 

Ahh okay. Here is basically what I am doing. I have a section highlighted in green that is what I'll be slowly building in to get our finished products and all the info. 

@RandyD79 

Thanks for the sample file.

It is still not clear to me that which column you want to populate with the formula depending on the province in column A.

 

If I read your original description which is as below...

If cell A2 has the word 'MB' in it, then it should add '192.104.'

If cell A2 has the word 'SK' in it, then it should add '192.103.'

If cell A2 has the word 'AB' in it, then it should add '192.102.'

If cell A2 has the word 'BC' in it, then it should add '192.101.'

 

All I understand is, the formula should look at the province in column A and add the network path (e.g. if province is MB, add 192.104.) but the question is, add 192.104. to what?

 

Can you explain your desired output for the first row and let me know if the province in A2 is AB and F2 is 192.102., which column you would be populating based on these two values?

 

Also, how many provinces you may have in column A? It would be easy to construct the formula if you create a Lookup table somewhere on the sheet or on another sheet to get what network path you need to add as per the province present in column A to avoid a long nesting IF formula.

 

OR

You want to populate the column F based on the province in column A?

e.g.

If cell A2 has the word 'AB' in it, then populate F2 with 192.102.?

@Subodh_Tiwari_sktneer 

 

Sorry, So column F should be blank until a province is added into column A. There's only four provinces that I'm doing this for. No idea if we'll ever expand into more or not. 

 

Column G and H are literally a drag down to get the next corresponding numbers. No formulas required.

Columns I, J and K are all based on the information in column F

 

 

Solution

@RandyD79 

So if all you need is to populate the column F based on province entered in column A, you may try something like this...

 

In F2

=IF(A2="","",IFERROR(VLOOKUP(A2,Subnet,2,0),""))

 

I have inserted a new sheet called "Lookup" where you can list all the provinces and their subnet.

I have also created a dynamic Named Range called "Subnet" which is used in the formula above.

You may add more provinces and their details on Lookup Sheet and your formula will be updated automatically as per the province you enter in column A if that province exists on Lookup Sheet.

 

So if A2 is AB, the formula will return 192.102. in F2.

 

But if you want F2 to return 192.102.1.0 in F2 as you showed in the cell F8 (green cell), you may tweak the formula as...

=IF(A8="","",IFERROR(VLOOKUP(A8,Subnet,2,0)&"1.0",""))

 

Fascinating! Thank you very much!

@RandyD79 

You're welcome! Glad it worked as desired.

Thanks for the feedback!

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies