Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default Transpose & offset data from a table

I have the following table and I would like to have each item on one row

# Acc# Dr Cr # Count Info
1271 1030 4.67 1 3 Cr
2200 0.27 1 3 Dr
6050 4.41 1 3 Dr
1288 1030 7.87 2 2 Cr
6090 7.87 2 2 Dr
1617 1030 61.9 3 4 Cr
2200 2.59 3 4 Dr
6050 4.11 3 4 Dr
6550 55.2 3 4 Dr
1958 1000 45.9 4 5 Cr
1000 39.2 4 5 Cr
2200 4.01 4 5 Dr
6310 37.4 4 5 Dr
6630 43.7 4 5 Dr


There is info that can help with determining items
Count - checks how many items should be transposed
Info - provides the information wheather is hould be under Cr or Dr accont

This is what I need as the result

DrAc DrAm CrAc CrAm DrAc DrAm DrAc DrAm
2200 0.27 1030 4.67 6050 4.41
6090 7.87 1030 7.87
2200 2.59 1030 61.9 6050 4.11 6550 55.2
2200 4.01 1000 45.9 6310 37.4 6630 43.7
etc
Can you help?
--
Greatly appreciated
Eva
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 257
Default Transpose & offset data from a table

Eva, I can't tell exactly what you're saying. I THINK you have data laid out
in multiple lines and now you want to change the layout so that multiple
lines are combined into one. Here's what I don't know:

1) What's supposed to happen to the two cols labeled "#"? Do you need them
preserved, or discarded?

2) Your starting format has an unpredictable number of debits and credits,
and in the output you need a fixed number of debit and credit columns. 2a)
Did you really want the target layout to be set up Db, Cr, Db, Db rather than
(for instance)? Wouldn't it be more convenient just to show debits with
positive numbers and credits with negatives (or of course vice versa)? or
perhaps Db, Db, Db, Cr, Cr, Cr? And 2b) no matter what the target layout,
what do you want done when a starting # has more debits or credits than the
target layout can handle? What, for instance, should be done with the second
credit in #1958, in your example? Do you just want to start a second line?

Depending on your answer to 2a, chances are it's going to be simpler to do
this in VBA than with worksheet functions.

--- "Eva" wrote:
I have the following table and I would like to have each item on one row

# Acc# Dr Cr # Count Info
1271 1030 4.67 1 3 Cr
2200 0.27 1 3 Dr
6050 4.41 1 3 Dr
1288 1030 7.87 2 2 Cr
6090 7.87 2 2 Dr
1617 1030 61.9 3 4 Cr
2200 2.59 3 4 Dr
6050 4.11 3 4 Dr
6550 55.2 3 4 Dr
1958 1000 45.9 4 5 Cr
1000 39.2 4 5 Cr
2200 4.01 4 5 Dr
6310 37.4 4 5 Dr
6630 43.7 4 5 Dr

There is info that can help with determining items
Count - checks how many items should be transposed
Info - provides the information wheather is hould be under Cr or Dr accont

This is what I need as the result

DrAc DrAm CrAc CrAm DrAc DrAm DrAc DrAm
2200 0.27 1030 4.67 6050 4.41
6090 7.87 1030 7.87
2200 2.59 1030 61.9 6050 4.11 6550 55.2
2200 4.01 1000 45.9 6310 37.4 6630 43.7

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,180
Default Transpose & offset data from a table

Excel 2007 PivotTable
Transpose data.
http://c0444202.cdn.cloudfiles.racks...01_21_10a.xlsx
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default Transpose & offset data from a table

Eva

You seem to have the data set up sensible already but you need to fill in
the First Id so that each row has the ID against it. Assuming that the blank
lines should have the last id sabove then this macro will add the lines for
you.

Sub FillIds()
Dim LRows as Long, i as long

LRows = Cells(Rows.Count, 2).End(xlUp).Row
For i = 2 To LRows
If IsEmpty(Cells(i, 1)) Then
Cells(i, 1) = Cells(i - 1, 1)
End If
Next i
End Sub

The macro is copied into the VB Editor. ALT + F11, Insert, Module and paste
the code into the module.

Make sure that you are in the sheet with the table and From the VB editor
press F5 to run the code, or, From the sheet Press ALT + F8 and select the
code and click Run.

You can now use a Pivot table or Data Subtotals with a Sum in each change in
Id.

SUb Totals look like this:

Id Acc# Dr Cr
1271 1030 4.67
1271 2200 0.27
1271 6050 4.41
1271 Total 4.68 4.67
1288 1030 7.87
1288 6090 7.87
1288 Total 7.87 7.87
1617 1030 61.9


And the Pivot Table looks like this.

Acc#
Id Data 1000 1030 2200
1271 Sum of Dr 0.27
Sum of Cr 4.67
1288 Sum of Dr
Sum of Cr 7.87

The Grand Total in the PT are on the Right.

Make sure that Sum is selected and not count.

If you really want the data transposed you will need a macro so post back or
start a new thread.

HTH
Peter


"Eva" wrote:

I have the following table and I would like to have each item on one row

# Acc# Dr Cr # Count Info
1271 1030 4.67 1 3 Cr
2200 0.27 1 3 Dr
6050 4.41 1 3 Dr
1288 1030 7.87 2 2 Cr
6090 7.87 2 2 Dr
1617 1030 61.9 3 4 Cr
2200 2.59 3 4 Dr
6050 4.11 3 4 Dr
6550 55.2 3 4 Dr
1958 1000 45.9 4 5 Cr
1000 39.2 4 5 Cr
2200 4.01 4 5 Dr
6310 37.4 4 5 Dr
6630 43.7 4 5 Dr


There is info that can help with determining items
Count - checks how many items should be transposed
Info - provides the information wheather is hould be under Cr or Dr accont

This is what I need as the result

DrAc DrAm CrAc CrAm DrAc DrAm DrAc DrAm
2200 0.27 1030 4.67 6050 4.41
6090 7.87 1030 7.87
2200 2.59 1030 61.9 6050 4.11 6550 55.2
2200 4.01 1000 45.9 6310 37.4 6630 43.7
etc
Can you help?
--
Greatly appreciated
Eva

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default Transpose & offset data from a table

Hi
Thank you for taking your time. These are my answers:
1) I don't need cols labeled "#".
2) My starting format has an unpredictable number of debits and credits same
as output
2) I should be fine if we can do it with cr and dr positive and negative
numbers
2) Db, Db, Db, Cr, Cr, Cr...etc is also fine
2b) I would like to have as many debits and credits as I have in the table
2b) The second credit (#1958 )should be there as well in a separate column -
I don't want to to start a second line

...I am not so good with VBA...I started to learn more about it, but I need
more time.


--
Greatly appreciated
Eva


"Bob Bridges" wrote:

Eva, I can't tell exactly what you're saying. I THINK you have data laid out
in multiple lines and now you want to change the layout so that multiple
lines are combined into one. Here's what I don't know:

1) What's supposed to happen to the two cols labeled "#"? Do you need them
preserved, or discarded?

2) Your starting format has an unpredictable number of debits and credits,
and in the output you need a fixed number of debit and credit columns. 2a)
Did you really want the target layout to be set up Db, Cr, Db, Db rather than
(for instance)? Wouldn't it be more convenient just to show debits with
positive numbers and credits with negatives (or of course vice versa)? or
perhaps Db, Db, Db, Cr, Cr, Cr? And 2b) no matter what the target layout,
what do you want done when a starting # has more debits or credits than the
target layout can handle? What, for instance, should be done with the second
credit in #1958, in your example? Do you just want to start a second line?

Depending on your answer to 2a, chances are it's going to be simpler to do
this in VBA than with worksheet functions.

--- "Eva" wrote:
I have the following table and I would like to have each item on one row

# Acc# Dr Cr # Count Info
1271 1030 4.67 1 3 Cr
2200 0.27 1 3 Dr
6050 4.41 1 3 Dr
1288 1030 7.87 2 2 Cr
6090 7.87 2 2 Dr
1617 1030 61.9 3 4 Cr
2200 2.59 3 4 Dr
6050 4.11 3 4 Dr
6550 55.2 3 4 Dr
1958 1000 45.9 4 5 Cr
1000 39.2 4 5 Cr
2200 4.01 4 5 Dr
6310 37.4 4 5 Dr
6630 43.7 4 5 Dr

There is info that can help with determining items
Count - checks how many items should be transposed
Info - provides the information wheather is hould be under Cr or Dr accont

This is what I need as the result

DrAc DrAm CrAc CrAm DrAc DrAm DrAc DrAm
2200 0.27 1030 4.67 6050 4.41
6090 7.87 1030 7.87
2200 2.59 1030 61.9 6050 4.11 6550 55.2
2200 4.01 1000 45.9 6310 37.4 6630 43.7



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default Transpose & offset data from a table

Hi
Thank you for taking your time to make a pivot table for me. I analyzed it
carefully and I did the same thing and it works! I am really grateful!
It is really awesome.
--
Greatly appreciated
Eva


"Herbert Seidenberg" wrote:

Excel 2007 PivotTable
Transpose data.
http://c0444202.cdn.cloudfiles.racks...01_21_10a.xlsx
.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default Transpose & offset data from a table

Thank you. Macro works fine :)
--
Greatly appreciated
Eva


"Billy Liddel" wrote:

Eva

You seem to have the data set up sensible already but you need to fill in
the First Id so that each row has the ID against it. Assuming that the blank
lines should have the last id sabove then this macro will add the lines for
you.

Sub FillIds()
Dim LRows as Long, i as long

LRows = Cells(Rows.Count, 2).End(xlUp).Row
For i = 2 To LRows
If IsEmpty(Cells(i, 1)) Then
Cells(i, 1) = Cells(i - 1, 1)
End If
Next i
End Sub

The macro is copied into the VB Editor. ALT + F11, Insert, Module and paste
the code into the module.

Make sure that you are in the sheet with the table and From the VB editor
press F5 to run the code, or, From the sheet Press ALT + F8 and select the
code and click Run.

You can now use a Pivot table or Data Subtotals with a Sum in each change in
Id.

SUb Totals look like this:

Id Acc# Dr Cr
1271 1030 4.67
1271 2200 0.27
1271 6050 4.41
1271 Total 4.68 4.67
1288 1030 7.87
1288 6090 7.87
1288 Total 7.87 7.87
1617 1030 61.9


And the Pivot Table looks like this.

Acc#
Id Data 1000 1030 2200
1271 Sum of Dr 0.27
Sum of Cr 4.67
1288 Sum of Dr
Sum of Cr 7.87

The Grand Total in the PT are on the Right.

Make sure that Sum is selected and not count.

If you really want the data transposed you will need a macro so post back or
start a new thread.

HTH
Peter


"Eva" wrote:

I have the following table and I would like to have each item on one row

# Acc# Dr Cr # Count Info
1271 1030 4.67 1 3 Cr
2200 0.27 1 3 Dr
6050 4.41 1 3 Dr
1288 1030 7.87 2 2 Cr
6090 7.87 2 2 Dr
1617 1030 61.9 3 4 Cr
2200 2.59 3 4 Dr
6050 4.11 3 4 Dr
6550 55.2 3 4 Dr
1958 1000 45.9 4 5 Cr
1000 39.2 4 5 Cr
2200 4.01 4 5 Dr
6310 37.4 4 5 Dr
6630 43.7 4 5 Dr


There is info that can help with determining items
Count - checks how many items should be transposed
Info - provides the information wheather is hould be under Cr or Dr accont

This is what I need as the result

DrAc DrAm CrAc CrAm DrAc DrAm DrAc DrAm
2200 0.27 1030 4.67 6050 4.41
6090 7.87 1030 7.87
2200 2.59 1030 61.9 6050 4.11 6550 55.2
2200 4.01 1000 45.9 6310 37.4 6630 43.7
etc
Can you help?
--
Greatly appreciated
Eva

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default Transpose & offset data from a table

Glad to help Eva

Thanks for the response.

Peter

"Eva" wrote:

Thank you. Macro works fine :)
--
Greatly appreciated
Eva


"Billy Liddel" wrote:

Eva

You seem to have the data set up sensible already but you need to fill in
the First Id so that each row has the ID against it. Assuming that the blank
lines should have the last id sabove then this macro will add the lines for
you.

Sub FillIds()
Dim LRows as Long, i as long

LRows = Cells(Rows.Count, 2).End(xlUp).Row
For i = 2 To LRows
If IsEmpty(Cells(i, 1)) Then
Cells(i, 1) = Cells(i - 1, 1)
End If
Next i
End Sub

The macro is copied into the VB Editor. ALT + F11, Insert, Module and paste
the code into the module.

Make sure that you are in the sheet with the table and From the VB editor
press F5 to run the code, or, From the sheet Press ALT + F8 and select the
code and click Run.

You can now use a Pivot table or Data Subtotals with a Sum in each change in
Id.

SUb Totals look like this:

Id Acc# Dr Cr
1271 1030 4.67
1271 2200 0.27
1271 6050 4.41
1271 Total 4.68 4.67
1288 1030 7.87
1288 6090 7.87
1288 Total 7.87 7.87
1617 1030 61.9


And the Pivot Table looks like this.

Acc#
Id Data 1000 1030 2200
1271 Sum of Dr 0.27
Sum of Cr 4.67
1288 Sum of Dr
Sum of Cr 7.87

The Grand Total in the PT are on the Right.

Make sure that Sum is selected and not count.

If you really want the data transposed you will need a macro so post back or
start a new thread.

HTH
Peter


"Eva" wrote:

I have the following table and I would like to have each item on one row

# Acc# Dr Cr # Count Info
1271 1030 4.67 1 3 Cr
2200 0.27 1 3 Dr
6050 4.41 1 3 Dr
1288 1030 7.87 2 2 Cr
6090 7.87 2 2 Dr
1617 1030 61.9 3 4 Cr
2200 2.59 3 4 Dr
6050 4.11 3 4 Dr
6550 55.2 3 4 Dr
1958 1000 45.9 4 5 Cr
1000 39.2 4 5 Cr
2200 4.01 4 5 Dr
6310 37.4 4 5 Dr
6630 43.7 4 5 Dr


There is info that can help with determining items
Count - checks how many items should be transposed
Info - provides the information wheather is hould be under Cr or Dr accont

This is what I need as the result

DrAc DrAm CrAc CrAm DrAc DrAm DrAc DrAm
2200 0.27 1030 4.67 6050 4.41
6090 7.87 1030 7.87
2200 2.59 1030 61.9 6050 4.11 6550 55.2
2200 4.01 1000 45.9 6310 37.4 6630 43.7
etc
Can you help?
--
Greatly appreciated
Eva

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
offset, transpose funcion Eva Excel Worksheet Functions 3 January 21st 10 06:41 PM
Transpose a data table jbjtc Excel Discussion (Misc queries) 7 September 5th 08 09:15 AM
Transpose? Offset? Variable starting cell Fin Analyst Excel Discussion (Misc queries) 4 April 26th 06 07:48 AM
Vlookups in a Pivot table brining back OFFSET Data tlk40us Excel Worksheet Functions 2 March 20th 06 05:52 PM
Data in table, may need to convert to columns with OFFSET? Ron H Excel Discussion (Misc queries) 5 July 31st 05 06:44 PM


All times are GMT +1. The time now is 01:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"