Forum Discussion

surya300810's avatar
surya300810
Copper Contributor
Mar 30, 2022
Solved

Looking for Help to indentify duplicates which respect to conditions

Looking for a formula for getting the duplicate data based on the highest version and then copy adjacent row data in next rows . 

Example : 

 

InpUt 

Name Set Type Version
95591Type 1 -
95692Type 3-
95692Type 1 -
96292Type 3-
96292Type 3A
96292Type 3B
96292Type 1 B
96292Type 2B
96293Type 3-
96293Type 3A
96293Type 3B
96293Type 2B
96293Type 1 B
87665Type 1 B
87665Type 3B
87665Type 1 C
87665Type 3C
87665Type 1 D
87665Type 3D
87665Type 1 E
95597Type 1 -
95597Type 2 -
95598Type3 -
95598Type2-

 

Output 

Name Set Type Version   
95591Type 1 -Type 1   
95692Type 3-   
95692Type 1 -   
96292Type 3-   
96292Type 3A   
96292Type 3BType 1 Type 2Type 3
96292Type 1 B   
96292Type 2B   
96293Type 3-   
96293Type 3A   
96293Type 3BType 1 Type 2Type 3
96293Type 2B   
96293Type 1 B   
87665Type 1 B   
87665Type 3B   
87665Type 1 C   
87665Type 3C   
87665Type 1 D   
87665Type 3D  Type 3
87665Type 1 EType 1   
95597Type 1 -Type 1 Type 2  
95597Type 2 -   
95598Type3 - Type2Type3
95598Type2-   
  • surya300810 Perhaps Power Query can do what you need. See attached file. Note that I changed some of the data as I believe it didn't coincide with the description/explanation in one of the screenshots you uploaded. I marked the changes yellow in the Input list.

     

11 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    surya300810 Perhaps Power Query can do what you need. See attached file. Note that I changed some of the data as I believe it didn't coincide with the description/explanation in one of the screenshots you uploaded. I marked the changes yellow in the Input list.

     

    • surya300810's avatar
      surya300810
      Copper Contributor
      Thanks for the response , and you solution is very near to the ideal solution only thing is my data set have one issue, that it is possible to have different versions for different type set - which is one of the mistakes in the data set which I need to identify and correct it - So the version value in row no 22 is correct as per the input data set
      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        surya300810 Not sure I follow. If C22 should indeed be a D, then it will no longer be included in the PQ generated table. Change it yourself and press Refresh All on the Data ribbon and see that item 87665 will only show E and Type 1. Isn't that what you want?

  • surya300810 

    I'm trying to understand what you want to do. Does the attached file show your intended result?

     

    For example in the post there is the input

    Name Set Type Version
    95591Type 1 -

     

    with the intended output:

    Name Set Type Version   
    95591Type 1 -Type 1 

     

    However there isn't a duplicate for Name 95591 and Version - in the data.

    • surya300810's avatar
      surya300810
      Copper Contributor
      Can you share the code for the Above attached PDF - Which will Solve half of my problem.
      • OliverScheurich's avatar
        OliverScheurich
        Gold Contributor

        surya300810 

        The data in the pdf. file was entered manually. Unfortunately i can't help you with what you actually want to do. I can't suggest a solution to select the duplicate names of the highest version with a formula or VBA.

         

        EDIT: You can click the button in cell H2 in the attached file to start the macro. This is the only solution i can offer. The result is what i entered manually in the pdf. file.

    • SSURYA300's avatar
      SSURYA300
      Copper Contributor

      OliverScheurich 

      Actually , I need to eliminate the duplicates for the all the lower revision for the  set types

      if there is no duplicate entry then we need to keep it and if we have different versions for different set types even for the same number then also we need to show it in the out put

       

      Ideal Output

       

       

       

Resources