Creating single lines of data from a multi-column table

Hi folks.

I have a client who wants us to import data held as a grid in Excel
into our software as a csv file. The data is held as follows:

Job No     Prod A      Prod B     Prod C
1234         6           7
1987                                 12
1545                     12           2
etc

To work correctly the csv file needs to create the above as:

"1234","Prod A","6"
"1234","Prod B","7"
"1987","Prod C","12"
"1545","Prod B","12"
"1545","Prod C","2"

In other words: create a line per job/product combination
incorporating the Product code into the line. The table also includes
jobs without any data.

I've searched everywhere for this one - perhaps I am asking the wrong
questions! Any help gratefully received.

Hywel
0
hywelis (5)
2/9/2005 5:14:19 PM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
375 Views

Similar Articles

[PageSpeed] 5

Are all those things in the third column numbers?  If yes, then...

This looks like a job for....Data|Pivottable

Add a single row of headers to your data (if you don't have them now).
select your data  A1:C9999 (through the bottom right corner)
Data|pivottable (actually, this menu item changes captions with versions of xl)
follow the wizard 
(just click Next until you get to a dialog that has a Layout button on it)
click that Layout button
Drag the header for the Job to the Row field.
drag the header for the ProdType to the Column field
drag the header for the Qty field to the data field

If you see "Count of qty" then double click on that one and
change it to Sum (sum of qty)

click ok and finish

Tada!

If you want to read more about the pivottable stuff, you may want to look at
some links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistance/2002/articles/xlconPT101.aspx

hywel wrote:
> 
> Hi folks.
> 
> I have a client who wants us to import data held as a grid in Excel
> into our software as a csv file. The data is held as follows:
> 
> Job No     Prod A      Prod B     Prod C
> 1234         6           7
> 1987                                 12
> 1545                     12           2
> etc
> 
> To work correctly the csv file needs to create the above as:
> 
> "1234","Prod A","6"
> "1234","Prod B","7"
> "1987","Prod C","12"
> "1545","Prod B","12"
> "1545","Prod C","2"
> 
> In other words: create a line per job/product combination
> incorporating the Product code into the line. The table also includes
> jobs without any data.
> 
> I've searched everywhere for this one - perhaps I am asking the wrong
> questions! Any help gratefully received.
> 
> Hywel

-- 

Dave Peterson
0
ec357201 (5290)
2/10/2005 12:30:13 AM
Thanks, Dave, but the numbers are in 3 separate columns - so job 1234
has got 6 of Prod 6 and 7 of Prod B.
Your solution produces:

1234,Sum of Prod A,6
<Blank>,Sum of Prod B,7
<Blank>, Sum of Prod C,<Blank>

Whereas I looking to show only non-zero values and the job on each
line, like this:

1234,Sum of Prod A,6
1234,Sum of Prod B,7

It's nearly there!

Hywel


Dave Peterson <ec35720@netscapeXSPAM.com> wrote in message news:<420AAB15.39DC5F6C@netscapeXSPAM.com>...
> Are all those things in the third column numbers?  If yes, then...
> 
> This looks like a job for....Data|Pivottable
> 
> Add a single row of headers to your data (if you don't have them now).
> select your data  A1:C9999 (through the bottom right corner)
> Data|pivottable (actually, this menu item changes captions with versions of xl)
> follow the wizard 
> (just click Next until you get to a dialog that has a Layout button on it)
> click that Layout button
> Drag the header for the Job to the Row field.
> drag the header for the ProdType to the Column field
> drag the header for the Qty field to the data field
> 
> If you see "Count of qty" then double click on that one and
> change it to Sum (sum of qty)
> 
> click ok and finish
> 
> Tada!
>
0
hywelis (5)
2/11/2005 9:30:12 AM
You dragged the header for the prodtype to the Row field.

You can fix it by going back to the wizard 
(rightclick anywhere in the pivottable and select wizard)

Then drag the header for the ProdType to the Column field

Or you can just drag the header for that prodtype to the cell directly to its
right (same row).  Right on top of the Total cell.

hywel wrote:
> 
> Thanks, Dave, but the numbers are in 3 separate columns - so job 1234
> has got 6 of Prod 6 and 7 of Prod B.
> Your solution produces:
> 
> 1234,Sum of Prod A,6
> <Blank>,Sum of Prod B,7
> <Blank>, Sum of Prod C,<Blank>
> 
> Whereas I looking to show only non-zero values and the job on each
> line, like this:
> 
> 1234,Sum of Prod A,6
> 1234,Sum of Prod B,7
> 
> It's nearly there!
> 
> Hywel
> 
> Dave Peterson <ec35720@netscapeXSPAM.com> wrote in message news:<420AAB15.39DC5F6C@netscapeXSPAM.com>...
> > Are all those things in the third column numbers?  If yes, then...
> >
> > This looks like a job for....Data|Pivottable
> >
> > Add a single row of headers to your data (if you don't have them now).
> > select your data  A1:C9999 (through the bottom right corner)
> > Data|pivottable (actually, this menu item changes captions with versions of xl)
> > follow the wizard
> > (just click Next until you get to a dialog that has a Layout button on it)
> > click that Layout button
> > Drag the header for the Job to the Row field.
> > drag the header for the ProdType to the Column field
> > drag the header for the Qty field to the data field
> >
> > If you see "Count of qty" then double click on that one and
> > change it to Sum (sum of qty)
> >
> > click ok and finish
> >
> > Tada!
> >

-- 

Dave Peterson
0
ec357201 (5290)
2/11/2005 10:32:24 PM
Reply:

Similar Artilces:

create a roster
How can you create a weekly roster in which functions can be assigned to more than 10 people. The roster should be updatable, so that when holidays and days off are marked on the weekly roster they will be taken account of it future rosters. ...

Attach Rows with Row Data
I am trying to sort by Data/Time in a Column, but if I sort by Date/Time, Just that changes, the other columns don't change with it. How can I either LOCK or ATTACH the Rpw data together so when I sort, Everything changes, not just the Date/Time? Thanks Mike Miller Hi just select the entire data range (all columns) prior to sorting your data -- Regards Frank Kabel Frankfurt, Germany "Admiral_Kirk_1" <Admiral_Kirk_1@discussions.microsoft.com> schrieb im Newsbeitrag news:BAFA6FEE-04C3-4AFB-9FA6-CFF7A41224C9@microsoft.com... > I am trying to sort by Data/Time in a ...

Problem importing Data into Outlook 2002 from 2003.
I'm hoping that someone out there has had this problem and can help me out. I did a backup on my other computer by exporting the data from Outlook 2003 to a file, then formatted the harddrive and am trying to import it into Outlook 2002 on a different computer and I get the following error: "The file Backup01262004.pst is not compatible with this version of the Personal Folders information service. Contact your administrator." Is there a utility or something that I can use to restore the file? Thank you in advance. Rich Previous versions of Outlook cannot read 2003's n...

Several (x, y) coordinated lines on one graph
I am trying to plot for the general (x, y) coordinated dataset. For example, Series A (1, 50) (8, 90) (10, 300) (300, 500) Series B (3, 80) (400, 90) Series C (30, 80) (200, 120) and so on. The data is store on single worksheet Series Name x coordinate y coordinate A 1 50 A 8 90 A 10 300 A 300 500 B 3 80 B ...

this is a test subject line
a test I say ...

importing or creating reference footnotes
I am trying to import a word document into publisher and it has reference footnotes within the document. The reference footnotes are not coming into the publisher document with the reference footnotes. Correct, they will not up to Publisher 2003. In Publisher 2003 depending on which version of Word you are using if they will or not. -- "If you don't know where you are going, any road will take you there!" ...

Task Create - Status
I'm trying to make a simple task, when a user owner is assigned a task in CRM, it receives an email letting it know it has one. I have the following below, but it is not generating one when i assign one manually in the CRM. What to do? I've tried both the following: When task is created E-Mail to:[owner];Subject test As well as: When task is created if Task activity status = Open then E-Mail to:[owner];Subject test I've checked the mailserver many times over, and I can send emails manually from the CRM so you can rule that out Tested out ok on our end. Some ideas:...

single, 6pack, 12pack
I need to know how to setup items that are sold in single, 6pack, 12pack items such as beer or soft drinks, and those items have a like UPC code. Thanks Phil The way we do it Phil is by placing a 1 infront of the upc of the single. So when a customer comes up to the register with that single they press a key on the keyboard that says single but its really just a one. Then we have the single then take away from the 6pk or 12pk depending on where it is coming from. "Phil V" wrote: > I need to know how to setup items that are sold in single, 6pack, 12pack > items such a...

Column Width Adjustment
Is there a way to adjust the column width automatically to fit the length of the longest data in the cell. I know how to do it one column at a time but not how to do all columns of data at once. Thanks, Jerry Do a <Ctrl> <A> to select the entire sheet, then, Do the same thing you would do for a single Column: <Format> <Column> <AutoFit> -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! -------------------------------------------------------------...

Mailbox not created when AD account created
A couple of days ago I noticed that I created a user account but the 'Email Addresses' tab of the user properies did not list any email addresses. Subsequent new user accounts have all experienced the same. I researched the knowledge and tried the recommended solutions to either manaully start the recipient update service or rebuild te recipient update service. Neither recommendation has resulted in a mailbox being created for this particular user or any additional user that I have created since this error first showed up. I performed a Windows update last Thursday and so I bel...

Inserting rows with Data, Formula's and Validation
Hi all, I posted this twice earlier today, but it hasn't appeared so if it triple post please forgive! I have a spreadsheet that starting at row 18 contains the following information A18=M$2 B18= Datavalidation indirect ($M$2) C18=IF(B18="No More Options",VLOOKUP($B18,INDIRECT(CONCATENATE($M$2,"_info")),1,FALSE),IF(B19<2,VLOOKUP($B18,INDIRECT(CONCATENATE($M$2,"_info")),1,FALSE),CONCATENATE(B19," x ",VLOOKUP($B18,INDIRECT(CONCATENATE($M$2,"_info")),1,FALSE)))) E18=IF(ISERROR(VLOOKUP($B18,INDIRECT(CONCATENATE($M$2,"_info"))...

Bug with cell merging in tables using Applescript
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Once you have merged cells in a table in Word 2008 using Applescript, any further reference to the table's cells in the script produce an error. <br><br>As an example, open Word 2008 and run this script: <br> tell application &quot;Microsoft Word&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make new table at active document with properties {number of rows:4, number of columns:4} <br> &nbsp;&nbsp;&nbsp;&nbsp...

Help Creating XmlNode / XmlAttribute Elegantly
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would consider this to be a hack but couldn't really see another way of doing this without definin...

Data Tables
Has anyone ever had a problem where a data table is producing incorrect values? I have a (two dimensional) table which is producing unexpected values. When I try to replicate these values through manually changing the inputs (and changing nothing else) I get a different result to that produced by the data tables. Just to check I'm not going completely mad, I've had a colleague confirm the symptoms. Any suggestions gratefully received before I head into investigating for corruptions etc Mike The only time I've ever had a problem with charting is when I had merged c...

chart label reference based on the column number
In a worksheet with an embedded chart, I have a cell, S4, where I enter the number of the column I want to chart (these numbers are listed as labels in cells A2:R2). I can't figure out how to translate the number in S4 into the corresponding column letter. For example, if S4 contains "3", the chart title should be =$C$2. I think working with absolute references, R1C1, might be easier here, but somehow what I've tried, didn't work (the entire spreadsheet is based on relative addresses (A1). z.entropic in a cell (Z100) put =index(A2:G2,1,S4,1) Change G2 to whatev...

Macro that inserts lines
I have this macro that inserts a line if the value in D changes and copy the value in D to A. I want this macro to only start looking in D14 or from row 14. tx for all the help Dim row_index As Long Application.ScreenUpdating = False lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row For row_index = lastrow - 1 To 2 Step -1 If Cells(row_index, "D").Value <> _ Cells(row_index + 1, "D").Value Then Cells(row_index + 1, "D").EntireRow.Insert _ (xlShiftDown) Cells(row_index + 1, 1).Value = Cells(row_index + ...

tabls in GP90 database
Does anyone know or have a description or documenation on the tables in the database for GP90? Maybe all I need is the important ones. thanks Within the program itself, Tools > Resource Descriptions Also, there are ERD's on the distribution CD's that you got when you purchased or upgraded the system - you have to install the SDK to get at them. -- Lyle U Adam Clark wrote: > Does anyone know or have a description or documenation on the tables > in the database for GP90? Maybe all I need is the important ones. > > thanks ...

Create external database
Hi all. I need to create an external database (file). On a site I found this code: ------------------------------------------------------ Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String 'strTargetDB = Source Database Name 'strProviderString = Not used, currently hard coded 'strSourceTbl = Source Table name in the database we are linking too. 'strLinkTblName = Table name we would like to see in the Access Database. Dim catDB As ADOX.Catalog Dim tblLink As...

How to create pie chart with %
I have got a problem that I don't if excel could help me to calculate the % within a column and draw a pie chart. My case is I have a column containing a series of numbers. e.g. 1,4,8,1,3,9,11,2,4,5,6,.........etc I want to draw a pie chart that showing 1-3 , 4-6, 7-9, >9 with the corresponding % inside that column. Can anyone tell me how can I make it ? Ray - You need to calculate the frequencies in your data. Let's assume your data is in A1:A12. In B1:B3 enter these numbers, the upper limits on the groupings: 3 6 9 You can enter ">9" into B4 witho...

Getting data from Several Work Books
Dear all, After some advis here, I have several workbooks all with different names but in the same directory I.E. Excel1.xls Excel2.xls Excel3.xls Excel4.xls In each of the above I want to get out the value for say A2. And put it in a totals.xls in the same directory. I started to do it and I got this as my value .. ='[Excel1.xls]Expense Report'!$R$20 <-------- This returned the correct value. When i opened the document again it asked if i wanted to "update" the workboog ... whick i did want to have the updated info, the pro...

Email address not created when a new user is created
All, This issue recently happened in my company. Upon creating a new user, the policy was set to create the smtp and X400 address automaticaly. Now when we create a user the smtp and x400 addresses are not created, and when attempting to setup the new user in outlook, the address cant be found. We are using exchange 2003 SP1 on Win2k3 servers. On Wed, 13 Jul 2005 06:49:07 -0700, "Bryan" <Bryan@discussions.microsoft.com> wrote: >All, >This issue recently happened in my company. Upon creating a new user, the >policy was set to create the smtp and X400 addres...

Stagnant cell for counting filtered data
I want to keep one cell that houses the count of the data depending on how it is filtered and that cell remain visible despite how it is filtered. I can't get the formula =COUNT(C9,C1:C100) to work or get it to stay visible if I change the filter. Place the formula in row 1 that contains your titles...........assuming you have these. =SUBTOTAL(2,C2:C100) the 2, means count If you don't have titles in row 1, place the formula after a blank row below your data. Note: you use COUNT in your original. COUNT only counts numerics. Maybe you want COUNTA which would be =SUBTOT...

Web query financial data into chart
Via a web query I import the Euro/Dollar exchange rate during e.g. 2.00 pm to 5.00 pm in a cell of an Excel sheet with a refresh rate of 1 minute. I like to plot this rate versus time over this period. How can I realize that? regards, Louis -- loconel ------------------------------------------------------------------------ loconel's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=33481 View this thread: http://www.excelforum.com/showthread.php?threadid=532821 You would have to use a macro to store the info on a sheet with a automatic defined name for the gra...

when form created
I have a form which was created by someone else (not a form template) which is like a questionnaire with empty boxes to be completed. When the boxes are typed in all the margins move to accommodate the words being typed. Is there a way to fix/lock the original form and then just fill in the blank boxes? I suspect this is set up as a table with auto resizing enabled. Displaying table gridlines (Table | Show Gridlines) will help you see what you're dealing with. Then select the table, go to the Table tab of Table Properties, click Options, and clear the check box for "A...

Exchange 2010 MRM, no log files being created
I'm hoping someone can help me with this issue....it has been driving me crazy for days. I have enabled MRM logging on our exchange server, and I can see that some of the policies are working when I run start-managedfolderassistant. We have a retention policy tag on the deleteditems folder, and this does work. The problem is I am not getting any files in the MRM log directory. C:\Program Files\Microsoft\Exchange Server\V14\Logging\Managed Folder Assistant Events 9021 and 9022 are logged in the Application log, but where are the files? Below is the output of my mai...