<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Excel - Concatenate fields through Vlookup...or something</title>
	<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something/</link>
	<description>Comments on Ask MetaFilter post Excel - Concatenate fields through Vlookup...or something</description>
	<pubDate>Fri, 09 Jun 2006 12:31:29 -0800</pubDate>
	<lastBuildDate>Fri, 09 Jun 2006 12:31:29 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Excel - Concatenate fields through Vlookup...or something</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something</link>	
		<description>Excel Filter: Concatenating fields through VLOOKUP.  Is it possible?  What I&apos;m trying to accomplish inside... &lt;br /&gt;&lt;br /&gt; I have two Worksheets in my Excel Workbook, DETAILS and APPS.  DETAILS is an export from a discovery application containing the software installed on each computer.  It looks something like this:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
A		B			C		D&lt;br&gt;
Serial#	User			Location	Title&lt;br&gt;
123456		Smith, John		Cleveland	Adobe Photoshop&lt;br&gt;
123456		Smith, John		Cleveland	Microsoft Project&lt;br&gt;
123456		Smith, John		Cleveland	Adobe Standard&lt;br&gt;
123456		Smith, John		Cleveland	SigmaPlot&lt;br&gt;
234567		Doe, Jane		Chicago	SigmaScan&lt;br&gt;
234567		Doe, Jane		Chicago	Lotus Notes&lt;br&gt;
345678		Williams, Ted	Cleveland	Microsoft Visio&lt;br&gt;
456789		Ruth, Babe		Atlanta	Microsoft Project&lt;br&gt;
456789		Ruth, Babe		Atlanta	Adobe Photoshop&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
By some magic use of the VLOOKUP, CONCATENATE, and IF statements (and/or whatever else needs to be used to get me there) I would like to populate my APPS worksheet.  My goal is to list the unique serial #&apos;s and then create a &quot;Title&quot; column which concatenates the &quot;Title&quot; field corepsonding to the &quot;Serial#&quot; field from the DETAILS worksheet.  I see it looking soemthing like this:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
A		B&lt;br&gt;
Serial#	Title&lt;br&gt;
123456		Adobe Photoshop;Microsoft Project;Adobe Standard;SigmaPlot&lt;br&gt;
234567		SigmaScan;Lotus Notes&lt;br&gt;
345678		Microsoft Visio&lt;br&gt;
456789		Microsoft Project;Adobe Photoshop&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
Does this make sense?  Is it possible?  Is there an easier way?  My end goal is to be able to bring the &quot;Title&quot; fields from the APPS worksheet into an MS Word Mail Merge, so I&apos;m open to hearing other suggestions that would accomplish my end goal.  Any help would be greatly appreciated.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.39861</guid>
		<pubDate>Fri, 09 Jun 2006 12:17:15 -0800</pubDate>
		<dc:creator>bwilms</dc:creator>
		
			<category>excel</category>
		
			<category>functions</category>
		
			<category>pivot</category>
		
			<category>table</category>
		
			<category>concatenate</category>
		
	</item> <item>
		<title>By: Kwantsar</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#614886</link>	
		<description>How many titles are you working with?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-614886</guid>
		<pubDate>Fri, 09 Jun 2006 12:31:29 -0800</pubDate>
		<dc:creator>Kwantsar</dc:creator>
	</item><item>
		<title>By: DevilsAdvocate</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#614888</link>	
		<description>Here&apos;s how I would do it:&lt;br&gt;
&lt;br&gt;
a) create a pivot table from your data, with serial# as the rows, and title as the columns.  (Note: this assumes the number of distinct software titles is less than ~256, the maximum number of columns in Excel.  And you probably need a few extra columns for the pivot table, so it&apos;s probably really a maximum of 254 or 253 or something like that.)&lt;br&gt;
&lt;br&gt;
b) create a second table (probably in a different worksheet) the same size as the pivot table.  You&apos;ll copy the row headers and column headers from the pivot table into this one, but in the body, instead of the numbers in the pivot table, use an IF referring back to the pivot table to insert the appropriate Title, followed by a semicolon, directly into the table itself if the value in the pivot table is non-zero, and leaving the cell blank if the corresponding cell in the pivot table is zero.&lt;br&gt;
&lt;br&gt;
c) Concatenate all the cells from a row of this second table into a single cell.  You can also remove the final trailing semicolon at this point if you want.&lt;br&gt;
&lt;br&gt;
That&apos;s how I would do it; it&apos;s entirely possible there&apos;s an easier way, though.  I don&apos;t know how much experience you have with Excel, so if you need more detailed instructions for doing the above, let me know.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-614888</guid>
		<pubDate>Fri, 09 Jun 2006 12:34:38 -0800</pubDate>
		<dc:creator>DevilsAdvocate</dc:creator>
	</item><item>
		<title>By: inigo2</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#614902</link>	
		<description>Is this something that will be done once?  Or will it be an ongoing process to keep updating this?&lt;br&gt;
&lt;br&gt;
I&apos;m thinking a macro could deal with this pretty well; I can sketch out something (just not now, sorry).&lt;br&gt;
&lt;br&gt;
Does the Apps page already have a list of all the unique IDs, or does that have to be compiled as you go, too?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-614902</guid>
		<pubDate>Fri, 09 Jun 2006 12:45:00 -0800</pubDate>
		<dc:creator>inigo2</dc:creator>
	</item><item>
		<title>By: bwilms</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#614915</link>	
		<description>Thanks for your quick responses.  To answer the questions...&lt;br&gt;
&lt;br&gt;
Kwantsar: I&apos;m working with 150-200 titles.&lt;br&gt;
&lt;br&gt;
DevilsAdvocate: I&apos;ve lost on you on B) a little bit, but I&apos;m seeing potential as I got it in the Pivot table.  I&apos;m not good with IF statements so (if you can) more detail would be very helpful.  I&apos;m going to keep playing and see if I can work through your instructions.&lt;br&gt;
&lt;br&gt;
inigo2: It&apos;ll be more of a one time thing.  I thought a macro would probably be able to pull it off, but I wouldn&apos;t even know where to start.  I don&apos;t expect anybody to code a macro for this, so don&apos;t sweat it (though I appreciate the consideration).  I am using the Serial# as the unique ID on the APPS sheet, and yes, they are all present and ready to be used (I hope that&apos;s what you were asking).&lt;br&gt;
&lt;br&gt;
Thanks again for your help.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-614915</guid>
		<pubDate>Fri, 09 Jun 2006 12:55:56 -0800</pubDate>
		<dc:creator>bwilms</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#614982</link>	
		<description>That looks to me like a problem you&apos;d be better off solving in Access or any other DB where you can do a JOIN on the tables.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-614982</guid>
		<pubDate>Fri, 09 Jun 2006 14:25:35 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: DevilsAdvocate</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#615050</link>	
		<description>OK, I&apos;m using your sample data above.  The column headers are in cells A1-D1 of Sheet1, and the actual data in A2-D10.  &lt;br&gt;
&lt;br&gt;
The pivot table is in Sheet2.  The serial numbers are in A5-A8; the Titles are in B4-H4.&lt;br&gt;
&lt;br&gt;
Now, create a new worksheet, if there&apos;s not already another blank one--let that be Sheet3.&lt;br&gt;
&lt;br&gt;
Copy/paste cells A5-A8 and B4-H4 of Sheet2 into the corresponding cells of Sheet3.&lt;br&gt;
&lt;br&gt;
Now, in B5, enter:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;=IF(Sheet2!B5&amp;gt;0,B$4&amp;amp;&quot;;&quot;,&quot;&quot;)&lt;/pre&gt;&lt;br&gt;
(Basic format of the IF instruction: the first argument is the test, the second argument is what the value is if the test is true, and the third argument is what the value is if the test is false.)&lt;br&gt;
&lt;br&gt;
Grab the lower right corner of B5 and drag it to H5, then to H8, to copy the formula into all cells from B5-H8.&lt;br&gt;
&lt;br&gt;
In I5, enter:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;=B5&amp;amp;C5&amp;amp;D5&amp;amp;E5&amp;amp;F5&amp;amp;G5&amp;amp;H5&lt;/pre&gt;&lt;br&gt;
or you can also use&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;=CONCATENATE(B5,C5,D5,E5,E5,F5,G5,H5)&lt;/pre&gt;&lt;br&gt;
(This is going to be the sucky part when you do it for real, because you&apos;ll have to enter all 150+ cells in the row.  Excel won&apos;t let you do =CONCATENATE(B5:H5), which is just stupid.  At least you only have to do it once.)&lt;br&gt;
&lt;br&gt;
Grab the corner of I5 and drag it down to I8 to fill all the cells.&lt;br&gt;
&lt;br&gt;
If you want to get rid of the trailing semicolon, you can enter&lt;br&gt;
&lt;pre&gt;=LEFT(I5,LEN(I5)-1)&lt;/pre&gt;&lt;br&gt;
in J5 and then drag the corner of that down to J8.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-615050</guid>
		<pubDate>Fri, 09 Jun 2006 15:28:33 -0800</pubDate>
		<dc:creator>DevilsAdvocate</dc:creator>
	</item><item>
		<title>By: Kwantsar</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#615078</link>	
		<description>You&apos;re good, devilsadvocate. Damn good. But the &quot;sucky part&quot; doesn&apos;t have to suck. &lt;br&gt;
&lt;br&gt;
1. use this in A1 of another sheet: =IF(COLUMN(A1) &amp;gt; 26, CHAR(INT((COLUMN(A1) - 1)/ 26) + 64) &amp;amp; CHAR(MOD(COLUMN(A1) - 1,26) + 65), CHAR(COLUMN(A1) +  64))  . Drag across 150 cells.&lt;br&gt;
&lt;br&gt;
2. In cell A2 immediately beneath, type =A1&amp;amp;5 . Drag across 150 cells.&lt;br&gt;
&lt;br&gt;
3. Copy those as unformatted cells into word (paste special again). &lt;br&gt;
&lt;br&gt;
4. Find and replace &quot;5&quot; with &quot;5,&quot;&lt;br&gt;
&lt;br&gt;
5. Copy.&lt;br&gt;
&lt;br&gt;
6. Insert into your CONCATENATE.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Step one courtesy of microsoft.public.excel.misc. I&apos;m sure there&apos;s an easier way, but this is pretty easy.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-615078</guid>
		<pubDate>Fri, 09 Jun 2006 16:11:56 -0800</pubDate>
		<dc:creator>Kwantsar</dc:creator>
	</item><item>
		<title>By: junesix</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#615326</link>	
		<description>I can&apos;t help but think there&apos;s an Array formula that can do this all in one go. I&apos;ll reply if I can figure it out.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-615326</guid>
		<pubDate>Fri, 09 Jun 2006 21:39:19 -0800</pubDate>
		<dc:creator>junesix</dc:creator>
	</item><item>
		<title>By: DevilsAdvocate</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#615447</link>	
		<description>Nicely done, Kwantsar.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-615447</guid>
		<pubDate>Sat, 10 Jun 2006 06:38:03 -0800</pubDate>
		<dc:creator>DevilsAdvocate</dc:creator>
	</item><item>
		<title>By: bwilms</title>
		<link>http://ask.metafilter.com/39861/Excel-Concatenate-fields-through-Vlookupor-something#616881</link>	
		<description>DevilsAdvocate: Thanks for taking the extra time.  I started to grasp your first comment and had it finished by the time you posted the second.  &lt;br&gt;
&lt;br&gt;
For what it&apos;s worth, once I replaced the pivot counts using the IF statement, I copied and pasted into a notepad window and saved it as a text document.  While in the document, I did a REPLACE on the tab spacing.  Then I opened it in Excel, which placed each row of text into a separate field, essentially concatenating it for me.&lt;br&gt;
&lt;br&gt;
A few MID statements later, I had the information I needed in separate fields.  It takes about 5 minutes for the whole process and it was well worth it.  Thanks again.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.39861-616881</guid>
		<pubDate>Mon, 12 Jun 2006 08:34:04 -0800</pubDate>
		<dc:creator>bwilms</dc:creator>
	</item>
	</channel>
</rss>
