Splitting multiple row cells into new rows

cspearsall

New Member
Joined
May 23, 2016
Messages
19
Imaging - ready to work.xlsx
ABCDE
1Procedure NameModality TypeProcedure CodeCPT
2BI BREAST CYST ASPIRATION LEFTBreast ImagingIMG61719000 19000 3611900001PR PUNCTURE ASPIRATION CYST BREAST PR PUNCTURE ASPIRATION CYST BREAST HC PUNC/ASPIR BREAST CYST
3BI BREAST CYST ASPIRATION RIGHTBreast ImagingIMG195219000 19000 3611900001PR PUNCTURE ASPIRATION CYST BREAST PR PUNCTURE ASPIRATION CYST BREAST HC PUNC/ASPIR BREAST CYST
4BI BREAST DUCTOGRAM LEFTBreast ImagingIMG57977053 77053 4017705301CHG MAMMARY DUCTOGRAM OR GALACTOGRAM SINGLE CHG MAMMARY DUCTOGRAM OR GALACTOGRAM SINGLE HC MAMMARY DUCTOGRAM, SINGLE - MAMMO BREAST DUCTOGRAM
Epic - fill in (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:G1,K1,I1Cell ValueduplicatestextYES



I need to find a way to make each of these matching rows in columns D & E into a separate row with the same information from columns A,B&C
 

Attachments

  • Excel Example.png
    Excel Example.png
    84.3 KB · Views: 2

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi,

If I may ... Extremely Smart Decision to build a Flat Database !!!
This will make your life SO much easier ... !!!

Just out of curiosity, how many rows are you dealing with ?
By the way ... sincerely Hope you do NOT have any merged cells ...
 
Upvote 0
@James006 - 1200-1300 rows and no merged cells

This is an extract from an EMR that we then have to cross reference with another EMR to match on CPT codes

Not sure what you mean by a flat database, from this data?
 
Upvote 0
Thanks for your answer ...

"Flat" means exactly what you are trying to achieve : Take Row 2, it does need to be "exploded " in 3 Rows where Column A,B,C are replicated and Columns C and D do split ...!!!

Could you check if the character which is being used as a Line Break is Alt+Enter or Char(10) ....
In cell F2, you can type =FIND(CHAR(10),E2)
 
Upvote 0
Show us an example of a mocked up solution for the sample data presented.
 
Upvote 0
@alansidman
Imaging - ready to work.xlsx
ABCDE
1Procedure NameModality TypeProcedure CodeCPT
2BI BREAST CYST ASPIRATION LEFTBreast ImagingIMG61719000 19000 3611900001PR PUNCTURE ASPIRATION CYST BREAST PR PUNCTURE ASPIRATION CYST BREAST HC PUNC/ASPIR BREAST CYST
3BI BREAST CYST ASPIRATION RIGHTBreast ImagingIMG195219000 19000 3611900001PR PUNCTURE ASPIRATION CYST BREAST PR PUNCTURE ASPIRATION CYST BREAST HC PUNC/ASPIR BREAST CYST
Epic - fill in (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:G1,K1,I1Cell ValueduplicatestextYES


Desired result
Imaging - ready to work.xlsx
ABCDE
1Procedure NameModality TypeProcedure CodeCPT
2BI BREAST CYST ASPIRATION LEFTBreast ImagingIMG61719000PR PUNCTURE ASPIRATION CYST BREAST
3BI BREAST CYST ASPIRATION LEFTBreast ImagingIMG61719000PR PUNCTURE ASPIRATION CYST BREAST
4BI BREAST CYST ASPIRATION LEFTBreast ImagingIMG6173611900001HC PUNC/ASPIR BREAST CYST
5BI BREAST CYST ASPIRATION RIGHTBreast ImagingIMG195219000 PR PUNCTURE ASPIRATION CYST BREAST
6BI BREAST CYST ASPIRATION RIGHTBreast ImagingIMG195219000PR PUNCTURE ASPIRATION CYST BREAST
7BI BREAST CYST ASPIRATION RIGHTBreast ImagingIMG19523611900001HC PUNC/ASPIR BREAST CYST
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:E1Cell ValueduplicatestextYES
 
Upvote 0
Also completely duplicate lines can be eliminated but I can do that later. I do not have access to re-export in a more favorable format
 
Upvote 0
If Alan come up with the adequate design for you ... a tailor-made Power Query would be ideal ... !!!

@alansidman The OP needs rows in Columns A,B,C to be replicated twice and Columns D and E split by character chr(10) ... in order for each original row to end up in 3 independent rows ... and a beautiful flat database allowing all sorts of Analysis ...
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,148
Members
449,098
Latest member
Doanvanhieu

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