Concatenating multiple lines based on a condition

webecho

New Member
Joined
Jul 12, 2017
Messages
1
I have a spreadsheet exported from MYOB ...
The format makes it useless for my purposes without a lot of manual deleting and copy/paste, so I'm trying to clean it up automatically.

4 Columns:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD][/TD]
[TD]Row Number[/TD]
[/TR]
[TR]
[TD]Product ID[/TD]
[TD]Product Name[/TD]
[TD]Date[/TD]
[TD]Quantity[/TD]
[TD][/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Prod-1-Code[/TD]
[TD]Prod-1-Name[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Useless Info[/TD]
[TD]Useless Info[/TD]
[TD]Useless Info[/TD]
[TD]1[/TD]
[TD][/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Useless Info[/TD]
[TD]Useless Info[/TD]
[TD]Useless Info[/TD]
[TD]1[/TD]
[TD][/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Prod-1-Name[/TD]
[TD]2[/TD]
[TD][/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]


Above is a simplified version of what I have.

What I'd like to do is combine the good info on one row (preferably in 3 cells)

Prod-1-Code Prod-1-Name 2 (total quantity)

The problem is that each Product has a different number of rows of "Useless Info"


So what I'm trying to do is say:

If the text in columns B and C matches
THEN
get A, B and D and put it somewhere.


I've tried a few ways and failed and I've not had much luck Googling as it's a bit difficult to describe what I want to do.


I really hope this makes sense to someone


Thanks in advance


webecho
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,832
Messages
6,181,231
Members
453,026
Latest member
cknader

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