SOLVED

Formula look at sheet 1, find duplicates in sheet 2 and copy ID from sheet 1 to each duplicate

%3CLINGO-SUB%20id%3D%22lingo-sub-1493750%22%20slang%3D%22en-US%22%3EFormula%20look%20at%20sheet%201%2C%20find%20duplicates%20in%20sheet%202%20and%20copy%20ID%20from%20sheet%201%20to%20each%20duplicate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493750%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20Excel%202016%20and%20I%20am%20in%20over%20my%20head%20on%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20write%20a%20formula%20to%20look%20at%20Sheet%201%20Column%20B%20and%20for%20every%20duplicate%20in%20Sheet%202%20Column%20B%20it%20will%20copy%20the%20unique%20anchor%2FID%20Number%20from%20Sheet%201%20Column%20A%20into%20Sheet%202%20Column%20A%20as%20shown%20by%20the%20arrows%20in%20the%20image.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEach%20worksheet%20will%20be%20updated%20on%20a%2C%20when%20needed%2C%20basis%20using%20a%20macro%20to%20import%20the%20Fruit%20and%20Product%20data%20so%20the%20formulas%20need%20to%20be%20dynamic%20and%20able%20to%20be%20copied%20down%20each%20column.%3C%2FP%3E%3CP%3EIf%20you%20look%20at%20the%20example%20in%20the%20image%20I%20am%20using%20fruit%20to%20explain%20my%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20each%20sheet%20Row%20A%20is%20the%20header.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESheet%201%20acts%20as%20a%20master%20record.%20Each%20cell%20in%20Column%20A%20(LookUp)%20has%20a%20unique%20number%20assigned%20to%20each%20type%20of%20fruit%20to%20act%20as%20a%20anchor%2FID%20Number.%20Each%20cell%20in%20Column%20B%20(Fruit)%20contains%20a%20type%20of%20fruit%2C%20each%20entry%20is%20unique.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESheet%202%20contains%20the%20different%20types%20of%20products%20made%20from%20each%20fruit.%20Each%20cell%20in%20Column%20A%20(LookUp)%20will%20match%20the%20equal%20LookUp%20in%20Sheet%201.%20Each%20cell%20in%20Column%20B%20contains%20the%20type%20of%20fruit.%20Each%20cell%20in%20Column%20C%20contains%20the%20type%20of%20product%20made%20using%20the%20fruit.%20So%20this%20means%20that%20there%20will%20be%20duplicates%20of%20fruit%20in%20Column%20B.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20write%20a%20formula%20to%20look%20at%20Sheet%201%20Column%20B%20and%20for%20every%20duplicate%20in%20Sheet%202%20Column%20B%20it%20will%20copy%20the%20unique%20anchor%2FID%20Number%20from%20Sheet%201%20Column%20A%20into%20Sheet%202%20Column%20A%20as%20shown%20by%20the%20arrows%20in%20the%20image.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20really%20appreciate%20and%20help%20or%20suggestions.%3C%2FP%3E%3CP%3EThanks%20in%20advance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LookUp.jpg%22%20style%3D%22width%3A%20792px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F201675i0C3E746E51E5D231%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LookUp.jpg%22%20alt%3D%22LookUp.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1493750%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-1493853%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20look%20at%20sheet%201%2C%20find%20duplicates%20in%20sheet%202%20and%20copy%20ID%20from%20sheet%201%20to%20each%20duplicate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493853%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F698877%22%20target%3D%22_blank%22%3E%40Belinea2010%3C%2FA%3E%26nbsp%3BHey%20you%20can%20use%20Vlookup%20formula%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20writing%20this%20in%20Sheet%202%20Cell%20B1%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D%2BVLOOKUP(Sheet2!A1%2CSheet1!%24A%241%3A%24B%24100%2C2%2CFALSE)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1493868%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20look%20at%20sheet%201%2C%20find%20duplicates%20in%20sheet%202%20and%20copy%20ID%20from%20sheet%201%20to%20each%20duplicate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493868%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F698877%22%20target%3D%22_blank%22%3E%40Belinea2010%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20enter%20into%20Sheet2!A2%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DINDEX(Sheet1!A%3AA%2CMATCH(Sheet2!%24B2%2CSheet1!B%3AB%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eand%20drag%20it%20down%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1493943%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20look%20at%20sheet%201%2C%20find%20duplicates%20in%20sheet%202%20and%20copy%20ID%20from%20sheet%201%20to%20each%20duplicate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493943%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F699938%22%20target%3D%22_blank%22%3E%40DevendraJain%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20suggestion%20which%20I%20really%20appreciate%20but%20as%20it%20did%20not%20work%20I%20thought%20you%20might%20like%20some%20feedback.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20should%20go%20in%20Sheet%202%20Cell%20A2%20and%20then%20copied%20down.%20It%20needed%20to%20start%20on%20row%202%20as%20each%20sheet%20has%20a%20header%20row.%20It%20goes%20in%20Column%20A%20because%20that%20is%20where%20the%20LookUp%20needs%20to%20be.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20in%20case%20there%20was%20a%20misunderstanding%20on%20my%20part%20I%20tried%20your%20formula%20in%20Sheet%202%20Cell%20A1%20and%20then%20in%20Cell%20B1%20but%20the%20result%20was%20the%20same.%20It%20returns%20the%20text%20of%20%E2%80%9CFRUIT%E2%80%9D%20in%20the%20first%20row%20and%20then%20when%20copied%20down%20it%20just%20produces%20%23N%2FA%20in%20each%20row.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20again%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1493947%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20look%20at%20sheet%201%2C%20find%20duplicates%20in%20sheet%202%20and%20copy%20ID%20from%20sheet%201%20to%20each%20duplicate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493947%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Sergei%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20formula%20works%20perfectly%20and%20does%20exactly%20what%20I%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20so%20much%20and%20I%20really%20appreciate%20your%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20regards%20Bel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494051%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20look%20at%20sheet%201%2C%20find%20duplicates%20in%20sheet%202%20and%20copy%20ID%20from%20sheet%201%20to%20each%20duplicate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494051%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F698877%22%20target%3D%22_blank%22%3E%40Belinea2010%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBel%2C%20you%20are%20welcome%2C%20glad%20to%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I am using Excel 2016 and I am in over my head on this.

 

I am trying to write a formula to look at Sheet 1 Column B and for every duplicate in Sheet 2 Column B it will copy the unique anchor/ID Number from Sheet 1 Column A into Sheet 2 Column A as shown by the arrows in the image.

 

Each worksheet will be updated on a, when needed, basis using a macro to import the Fruit and Product data so the formulas need to be dynamic and able to be copied down each column.

If you look at the example in the image I am using fruit to explain my issue.

 

For each sheet Row A is the header.

 

Sheet 1 acts as a master record. Each cell in Column A (LookUp) has a unique number assigned to each type of fruit to act as a anchor/ID Number. Each cell in Column B (Fruit) contains a type of fruit, each entry is unique.

 

Sheet 2 contains the different types of products made from each fruit. Each cell in Column A (LookUp) will match the equal LookUp in Sheet 1. Each cell in Column B contains the type of fruit. Each cell in Column C contains the type of product made using the fruit. So this means that there will be duplicates of fruit in Column B.

 

I am trying to write a formula to look at Sheet 1 Column B and for every duplicate in Sheet 2 Column B it will copy the unique anchor/ID Number from Sheet 1 Column A into Sheet 2 Column A as shown by the arrows in the image.

 

I would really appreciate and help or suggestions.

Thanks in advance.

 

LookUp.jpg

 

5 Replies
Highlighted

@Belinea2010 Hey you can use Vlookup formula

 

Try writing this in Sheet 2 Cell B1

 

=+VLOOKUP(Sheet2!A1,Sheet1!$A$1:$B$100,2,FALSE)

Highlighted
Best Response confirmed by Belinea2010 (New Contributor)
Solution

@Belinea2010 

You may enter into Sheet2!A2

=INDEX(Sheet1!A:A,MATCH(Sheet2!$B2,Sheet1!B:B,0))

and drag it down

Highlighted

@DevendraJain 

Hi

 

Thank you for your suggestion which I really appreciate but as it did not work I thought you might like some feedback.

 

The formula should go in Sheet 2 Cell A2 and then copied down. It needed to start on row 2 as each sheet has a header row. It goes in Column A because that is where the LookUp needs to be.

 

Just in case there was a misunderstanding on my part I tried your formula in Sheet 2 Cell A1 and then in Cell B1 but the result was the same. It returns the text of “FRUIT” in the first row and then when copied down it just produces #N/A in each row.

 

Thanks again

Highlighted

@Sergei Baklan 

 

Hi Sergei

 

Your formula works perfectly and does exactly what I need.

 

Thank you so much and I really appreciate your help.

 

Kind regards Bel

Highlighted