+ Reply to Thread
Results 1 to 14 of 14

merge data based on column

  1. #1
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    merge data based on column

    hi
    I would merge data by macro based on COL B with summing the values. in col I if contains the same values not shouldn't sum based on duplicated item in COL B and if the values are different for duplicate items in COL B then should calculate and using function average . so I put expected result in sheet OUTPUT
    note: the duplicated items are existed in the same sheet and the others and I creat a new sheet every time so it should be dynamic
    Attached Files Attached Files
    Last edited by leap out; 09-08-2021 at 06:15 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: merge data based on coilumn

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: merge data based on coilumn

    Please try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on coilumn

    @Jindon this is magnificent !
    but I said
    I creat a new sheet every time so it should be dynamic
    it doesn't seem clear . what I want when creat new sheets (report3,4...and so on ) before sheet output should be dynamic when summing data all of data before sheet ouput .
    about this
    if the values are different for duplicate items in COL B then should calculate and using function average
    if I have BAT-OIL-100 contain differnt values like 400,420 should calculate average
    thanks again
    Last edited by leap out; 09-08-2021 at 04:53 AM.

  5. #5
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on coilumn

    @Bo_Ry thanks but I have three thing to fix it
    first should show number formatting
    second should calculate average if I have two different values for duplicate item
    third this is my mistake and I really sorry in COL D should also merege with comma as in COL C
    I put in COL D and highlight how should be like COL C
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on coilumn

    @jindon please see the file in post # 5 about COL D . forgive me I forgot to mention that . it should like COL C.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: merge data based on coilumn

    If the number always have 4 digits then simply
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on coilumn

    If the number always have 4 digits then simply
    sorry I don't understand . what you mean?
    I would change this

    HTML Code: 
    to this
    HTML Code: 
    to become more dynamically . not every time when add new sheet I have to write sheet name in array line
    about the calculate average I highlighted the different values by yellow and highlighted by red for duplicate item and highlight by blue should merge data in COL D as in col C with comma
    I hope this help you
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: merge data based on column

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on column

    @jindon
    every thing is ok except one thing in COL D should be like COL C CUS-OL-1,2

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: merge data based on column

    change to
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on column

    @jindon great work ! thanks for your time and solution

  13. #13
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: merge data based on column

    Try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    01-08-2021
    Location
    Asia
    MS-Off Ver
    2016
    Posts
    324

    Re: merge data based on column

    @Bo_Ry thanks again for updating your code

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. code sum and merge data based on repeated data
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-24-2020, 11:08 AM
  2. Replies: 5
    Last Post: 11-15-2018, 10:54 PM
  3. Merge data from two spreadsheets based on ID
    By henryBukowski in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2018, 11:03 AM
  4. [SOLVED] Macro to merge data based on user name
    By jw01 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 07-12-2017, 06:08 PM
  5. Based on Header merge the data
    By Baskar5353 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2015, 02:26 AM
  6. Replies: 0
    Last Post: 06-24-2015, 02:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1