Merge or Combine Rows of Data into One Row, but keeping specific data

gexcel15

New Member
Joined
Jan 6, 2015
Messages
24
Hello, I have a spreadsheet with multiple lines and an employee may have multiple lines. I would I go about combining those employees that have multiple lines, keeping data from a specific cell?

For example, in the table below, employee Mickey Mouse has two "Benefit Plan" elections. Looking for a way to combine his elections in one column, but keeping the data in columns, E & J

Hope I'm explaining myself with some understanding. Any help is greatly appreciated!

1609271155907.png
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I am not quite sure I understand.
Can you post an image of your expected results, based on the example you have provided?

Note that MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

There is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
I am not quite sure I understand.
Can you post an image of your expected results, based on the example you have provided?

Note that MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

There is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Hello Joe4,

The expected result is to only have "one" line per employee with both totals in separate columns.

Let's take Mickey Mouse in the example above:
I just need one line with Mickey's name, but Column D and Column J data should be in separate columns for the employee, but on the same line, not 2 lines of data.

I'm thinking a pivot table would be best, just not sure.

Thanks for any help you can provide.
Gwen

Employee IDLegal Name - Last NameLegal Name - First NameBenefit PlanCoverage Begin Date for Benefit PlanCurrent Election Coverage Begin DateCoverage End DateDate Last ChangedBenefit Elections - Currently Enrolled as of Report Effective DateCoverage
1234DoeJane401(k) Pre-Tax1/5/202012/17/202012/17/2020 6:03Yes6%
1234DoeJane401(k) Pre-Tax1/5/202012/10/202012/10/2020 6:04Yes10%
9876DoeJohn401(k) Roth6/11/202012/10/202012/10/2020 6:04Yes2%
6789DoverBen401(k) Pre-Tax1/5/20201/5/20201/2/2020 15:58Yes10%
6789DoverBen401(k) Pre-Tax1/5/20201/5/20201/2/2020 15:58Yes5%
4444MouseMickey401(k) After-Tax1/5/20201/5/20201/2/2020 15:58Yes7%
4444MouseMickey401(k) Transition Credit1/5/20201/5/20201/2/2020 15:58Yes3%
2424DuckDaffy401(k) Pre-Tax1/5/20204/2/20204/2/2020 6:15Yes9%
2424DuckDaffy401(k) Roth1/5/20204/2/20204/2/2020 6:15Yes9%
3657WhiteSnow401(k) Roth1/12/20204/2/20204/2/2020 6:09Yes21%
 
Upvote 0
Are columns A, B, C,D, and J the only columns that you need in this output?
Are you looking for an automated (VBA) solution, or a formulaic solution that you will set up manually?

I am not sure Pivot Tables can be used, because though they cannot summarize data, I don't think they can turn one column into two. You would at least need to do something like make another copy of the column.
 
Upvote 0
Are columns A, B, C,D, and J the only columns that you need in this output?
Are you looking for an automated (VBA) solution, or a formulaic solution that you will set up manually?

I am not sure Pivot Tables can be used, because though they cannot summarize data, I don't think they can turn one column into two. You would at least need to do something like make another copy of the column.
Joe4,

Yes, those are the only columns needed and any output will work, VBA or formulaic. I can read VBA (lol), just can't write it... Go figure!

Thanks,
 
Upvote 0
In looking at the "Benefit Plan" column, it looks like you have 4 different values.
So doesn't that mean that you would need 4 different columns for each person, one for each possibility?
 
Upvote 0
In looking at the "Benefit Plan" column, it looks like you have 4 different values.
So doesn't that mean that you would need 4 different columns for each person, one for each possibility?
Yes - that is correct!
 
Upvote 0
OK, here is one way you can do it.

First, I making the following assumptions:
1. The data you posted is on "Sheet1", starting in cell A1
2. The output will be on "Sheet2"

Now, perform the following steps:
1. Copy columns A-C from Sheet1 to Sheet2 (to the same columns)
2. Select columns A-C on Sheet2, and from the Data menu, select the "Remove Duplicates" functionality to remove all duplicate records.
3. In cells D1:G1 on sheet 2, enter the name of your 4 benefit plans, exactly as they appear in your data.
4. Enter the following formula in cell D2:
Excel Formula:
=SUMIFS(Sheet1!$J:$J,Sheet1!$A:$A,Sheet2!$A2,Sheet1!$D:$D,Sheet2!D$1)
5. Copy that formula to cells E2:G2, and then down all rows

I believe this should give you what you want.
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top