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
|