Help me I've lost days trying to extract and concatenate unique values

DigitalZugzwang

New Member
Joined
Jul 27, 2017
Messages
20
In the table below is for a job tracking project. Job No, defines the job. Site, where the job happened. Act, the activity that took place. Comp, the component involved in the activity. Finally, costc, which are the cost centers for the implementation of the act+comp.

What I'm trying to do is:
1st - extract the site based on job number. I can do this with {=index([site],match(0,if($b$1=[job no],countif($g$1:g1,[site],""),0)) I do wonder if there is a better way than an array as the table gets larger?

2nd - How to extract and concatenate the act and related comp for each site of the job. This is the part I'm totally stuck on.

[TABLE="width: 530"]
<colgroup><col width="99" style="width:74pt" span="4"> <col width="134" style="width:100pt"> </colgroup><tbody>[TR]
[TD="width: 99, bgcolor: #5B9BD5"]site[/TD]
[TD="width: 99, bgcolor: #5B9BD5"]act[/TD]
[TD="width: 99, bgcolor: #5B9BD5"]comp[/TD]
[TD="width: 99, bgcolor: #5B9BD5"]costc[/TD]
[TD="width: 134, bgcolor: #5B9BD5"]Job No[/TD]
[/TR]
[TR]
[TD]Test[/TD]
[TD]Install[/TD]
[TD]Antenna[/TD]
[TD]Labor[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Test[/TD]
[TD="bgcolor: transparent"]install[/TD]
[TD="bgcolor: transparent"]Antenna[/TD]
[TD="bgcolor: transparent"]Materials[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[/TR]
[TR]
[TD]Test[/TD]
[TD]install[/TD]
[TD]Antenna[/TD]
[TD]Equipment[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Test[/TD]
[TD="bgcolor: transparent"]Decom[/TD]
[TD="bgcolor: transparent"]Lines[/TD]
[TD="bgcolor: transparent"]Labor[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[/TR]
[TR]
[TD]Test[/TD]
[TD]Decom[/TD]
[TD]Radio[/TD]
[TD]Labor[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]OMG[/TD]
[TD="bgcolor: transparent"]Maintain[/TD]
[TD="bgcolor: transparent"]Antenna[/TD]
[TD="bgcolor: transparent"]Labor[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[/TR]
[TR]
[TD]OMG[/TD]
[TD]Maintain[/TD]
[TD]Radio[/TD]
[TD]Labor[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]OMG[/TD]
[TD="bgcolor: transparent"]Maintain[/TD]
[TD="bgcolor: transparent"]Lines[/TD]
[TD="bgcolor: transparent"]Labor[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[/TR]
[TR]
[TD]Test[/TD]
[TD]Install[/TD]
[TD]Lines[/TD]
[TD]Labor[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Test[/TD]
[TD="bgcolor: transparent"]Install[/TD]
[TD="bgcolor: transparent"]Lines[/TD]
[TD="bgcolor: transparent"]Equipment[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[/TR]
[TR]
[TD]SmellsBad[/TD]
[TD]decom[/TD]
[TD]Antenna[/TD]
[TD]Labor[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]SmellsBad[/TD]
[TD="bgcolor: transparent"]decom[/TD]
[TD="bgcolor: transparent"]Antenna[/TD]
[TD="bgcolor: transparent"]Equipment[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[/TR]
[TR]
[TD]SmellsBad[/TD]
[TD]decom[/TD]
[TD]Antenna[/TD]
[TD]Materials[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Need1more[/TD]
[TD="bgcolor: transparent"]Maintain[/TD]
[TD="bgcolor: transparent"]Antenna[/TD]
[TD="bgcolor: transparent"]Labor[/TD]
[TD="bgcolor: transparent, align: right"]3[/TD]
[/TR]
[TR]
[TD]Need1more[/TD]
[TD]Maintain[/TD]
[TD]Radio[/TD]
[TD]Labor[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Need1more[/TD]
[TD="bgcolor: transparent"]Maintain[/TD]
[TD="bgcolor: transparent"]Radio[/TD]
[TD="bgcolor: transparent"]Equipment[/TD]
[TD="bgcolor: transparent, align: right"]3[/TD]
[/TR]
[TR]
[TD]ROLF[/TD]
[TD]Install[/TD]
[TD]Radio[/TD]
[TD]Labor[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]ROLF[/TD]
[TD="bgcolor: transparent"]Install[/TD]
[TD="bgcolor: transparent"]Radio[/TD]
[TD="bgcolor: transparent"]Equipment[/TD]
[TD="bgcolor: transparent, align: right"]3[/TD]
[/TR]
[TR]
[TD]ROLF[/TD]
[TD]Install[/TD]
[TD]Radio[/TD]
[TD]Materials[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]OMG[/TD]
[TD="bgcolor: transparent"]Install[/TD]
[TD="bgcolor: transparent"]Lines[/TD]
[TD="bgcolor: transparent"]Labor[/TD]
[TD="bgcolor: transparent, align: right"]4[/TD]
[/TR]
[TR]
[TD]OMG[/TD]
[TD]Install[/TD]
[TD]Lines[/TD]
[TD]Equipment[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]OMG[/TD]
[TD="bgcolor: transparent"]Install[/TD]
[TD="bgcolor: transparent"]Antenna[/TD]
[TD="bgcolor: transparent"]Labor[/TD]
[TD="bgcolor: transparent, align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]


So doing this for Job No 1 should result in:


[TABLE="width: 247"]
<colgroup><col width="113" style="width:85pt"> <col width="134" style="width:100pt"> </colgroup><tbody>[TR]
[TD="width: 113, bgcolor: transparent"]Site[/TD]
[TD="width: 134, bgcolor: transparent"]Description[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Test[/TD]
[TD="bgcolor: transparent"]Install: Antenna; Decom: Lines, Radio[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]SmellsBad[/TD]
[TD="bgcolor: transparent"]Decom: Antenna[/TD]
[/TR]
</tbody>[/TABLE]

Thank you in advanced for any and all help, advice, and/or insight. This has been killing me for days!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Welcome to the forums!

We actually may be able to get a bit crafty with pivot tables to accomplish this.

Try this out. Create a PivotTable with that data. put "Job No", and "Costc" in the "Filters" Area, put "Site", "act", and "comp" in the rows field. Now go to the Design tab under PivotTable Tools.
* Under "Subtotals", choose "Do Not Show Subtotals".
* Under "Grand Totals", choose "Off For Rows and Columns"
* Under "Report Layout", choose "Show in Tabular Form"

Now, you can use the Job No dropdown and the costc dropdown to filter your data to display the summary.


Excel 2013/2016
ABC
1Job No1
2costcLabor
3
4siteactcomp
5SmellsBadDecomAntenna
6TestDecomLines
7InstallAntenna
Sheet10
 
Last edited:
Upvote 0
That worked excellent but I guess I didn't point out one part. The reason for this is to be able to generate a bid quote or an invoice or something along those lines. I was working with pivot tables earlier (no where as nice as this turned out) but I couldn't figure out how to extract it into a form where I could have the site listed with the act/comp info concatenated. Do you know how to pull the info off of the pivot table?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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