Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default convert multicolumn/multirow table into two structured/formatted columns = feasible?

Hi all,

I know this is an extremely tough one and I don't expect here any final
answer on this - some enlightening guidelines (f. ex. if it's feasible...)
would be already great!

I have a huge excel table (database) that involves child (unique) and parent
(not unique) accounts and is constructed like this:

A B C
D,E,F etc...
child1 parent of this child1 parent of the account on the left
etc... (until the highest level)
child2 parent of this child2 parent of the account on the left
etc... (until the highest level)
child3 parent of this child3 parent of the account on the left
etc... (until the highest level)
child4 parent of this child4 parent of the account on the left
etc... (until the highest level)
child5 parent of this child5 parent of the account on the left
etc... (until the highest level)
child6 parent of this child6 parent of the account on the left
etc... (until the highest level)
child7 parent of this child7 parent of the account on the left
etc... (until the highest level)
child8 parent of this child8 parent of the account on the left
etc... (until the highest level)
child9 parent of this child9 parent of the account on the left
etc... (until the highest level)
....
childn parent of this childn parent of the account on the left
etc... (until the highest level)

I have more than 3000 rows and 15 columns (=levels) of this three-like
structure... (some rows have 15 levels, some others finish as early as after
4 levels, then it's blank)
Based on this, I would like to convert it into an accounting-like scheme (f.
ex. column A = accounts; column B = amounts (or SUM formulas where
appropriate)):

child1
child2
child3
Parent of these 3 child accounts (formatted differently (level 1 parent))
(=SUM of all the relevant childs)
child4
child5
Parent of these 2 accounts (formatted level 1 parent) (=SUM of all the
relevant childs)
Parent of both parents above... (formatted level 2 parents) (=SUM of all the
relevant parents level 1)
etc... (until the end)

Of course if any other structure is easier to achieve (and will make the
same job, i.e. to recreate balance-sheet structure), I'm open to all
suggestions...
Many thanks in advance for any comments on this!

Regards,
Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default convert multicolumn/multirow table into two structured/formatted c

I think this was real easy.
I moved the 3 column data to columns A - c. then I sorted on column c as
first Key and column B as 2nd key. next I compared column b to determine
where each parentt acount started and end. Then I put the sum of the parents
account in column d.


let me know if I'm right or what modification are required.

Sub refomtchild()

RowCount = 1
Do While Cells(RowCount, "A") < ""
If Not IsEmpty(Cells(RowCount, "E")) Then
Rows(RowCount + 1).Insert
LastCol = Cells(RowCount, Columns.Count). _
End(xlToLeft).Column
Set cutrange = Range(Cells(RowCount, "D"), _
Cells(RowCount, LastCol))
cutrange.Cut Destination:=Cells(RowCount + 1, "A")
End If
RowCount = RowCount + 1
Loop

'sort by parent then child
Range("A2:C" & (RowCount - 1)).Sort _
Key1:=Range("C2"), _
Order1:=xlAscending, _
Key2:=Range("B2"), _
Order2:=xlAscending, _
Header:=xlGuess



'put in subtotals
RowCount = 1

StartRow = 1
Do While Cells(RowCount, "A") < ""
If Cells(RowCount, "B") < Cells(RowCount + 1, "B") Then
Cells(RowCount, "D").Formula = "=Sum(A" & StartRow & _
":A" & RowCount & ")"
StartRow = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End Sub


"markx" wrote:

Hi all,

I know this is an extremely tough one and I don't expect here any final
answer on this - some enlightening guidelines (f. ex. if it's feasible...)
would be already great!

I have a huge excel table (database) that involves child (unique) and parent
(not unique) accounts and is constructed like this:

A B C
D,E,F etc...
child1 parent of this child1 parent of the account on the left
etc... (until the highest level)
child2 parent of this child2 parent of the account on the left
etc... (until the highest level)
child3 parent of this child3 parent of the account on the left
etc... (until the highest level)
child4 parent of this child4 parent of the account on the left
etc... (until the highest level)
child5 parent of this child5 parent of the account on the left
etc... (until the highest level)
child6 parent of this child6 parent of the account on the left
etc... (until the highest level)
child7 parent of this child7 parent of the account on the left
etc... (until the highest level)
child8 parent of this child8 parent of the account on the left
etc... (until the highest level)
child9 parent of this child9 parent of the account on the left
etc... (until the highest level)
....
childn parent of this childn parent of the account on the left
etc... (until the highest level)

I have more than 3000 rows and 15 columns (=levels) of this three-like
structure... (some rows have 15 levels, some others finish as early as after
4 levels, then it's blank)
Based on this, I would like to convert it into an accounting-like scheme (f.
ex. column A = accounts; column B = amounts (or SUM formulas where
appropriate)):

child1
child2
child3
Parent of these 3 child accounts (formatted differently (level 1 parent))
(=SUM of all the relevant childs)
child4
child5
Parent of these 2 accounts (formatted level 1 parent) (=SUM of all the
relevant childs)
Parent of both parents above... (formatted level 2 parents) (=SUM of all the
relevant parents level 1)
etc... (until the end)

Of course if any other structure is easier to achieve (and will make the
same job, i.e. to recreate balance-sheet structure), I'm open to all
suggestions...
Many thanks in advance for any comments on this!

Regards,
Mark



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default convert multicolumn/multirow table into two structured/formatted columns

Hi Joel,
Many thanks for your involvement and quick answer!

I've tried your macro and unfortunately the problem is more complex than
this... :-(
Probably I haven't made myself sufficiently clear...

The data (account names) are already in area A1:N3100. The problem is that
for some accounts it will take, let's say, sevel levels to arrive to the
top/final parent account "Total Assets", and for others, they will need only
2 levels to get there. So, in one row columns A to G will be filled in
(child1=its parent=parent's parent=...="Total assets" account), and in
another, we'll have only columns A to C filled in (child1=its
parent=immediately "Total assets" account). You see? So, we can have the
same account name in several different columns, everything depends of the
depth of a particular asset class.

Second thing is that I don't have the amounts in this table for the moment,
only account names (then, once I arrive to have the accounts structured in
only one column (with the subtotals etc...), I'll add the extraction formula
from external database for every child account (for this, I know how to deal
with...) to the column next to it: so, in column A i plan to have all the
account names, and in column B I'll have the amounts extracted, except for
the subtotals (=parent accounts).

Sorry if I wasn't sufficiently explicit before...
Mark

"Joel" wrote in message
...
I think this was real easy.
I moved the 3 column data to columns A - c. then I sorted on column c as
first Key and column B as 2nd key. next I compared column b to determine
where each parentt acount started and end. Then I put the sum of the
parents
account in column d.


let me know if I'm right or what modification are required.

Sub refomtchild()

RowCount = 1
Do While Cells(RowCount, "A") < ""
If Not IsEmpty(Cells(RowCount, "E")) Then
Rows(RowCount + 1).Insert
LastCol = Cells(RowCount, Columns.Count). _
End(xlToLeft).Column
Set cutrange = Range(Cells(RowCount, "D"), _
Cells(RowCount, LastCol))
cutrange.Cut Destination:=Cells(RowCount + 1, "A")
End If
RowCount = RowCount + 1
Loop

'sort by parent then child
Range("A2:C" & (RowCount - 1)).Sort _
Key1:=Range("C2"), _
Order1:=xlAscending, _
Key2:=Range("B2"), _
Order2:=xlAscending, _
Header:=xlGuess



'put in subtotals
RowCount = 1

StartRow = 1
Do While Cells(RowCount, "A") < ""
If Cells(RowCount, "B") < Cells(RowCount + 1, "B") Then
Cells(RowCount, "D").Formula = "=Sum(A" & StartRow & _
":A" & RowCount & ")"
StartRow = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End Sub


"markx" wrote:

Hi all,

I know this is an extremely tough one and I don't expect here any final
answer on this - some enlightening guidelines (f. ex. if it's
feasible...)
would be already great!

I have a huge excel table (database) that involves child (unique) and
parent
(not unique) accounts and is constructed like this:

A B C
D,E,F etc...
child1 parent of this child1 parent of the account on the left
etc... (until the highest level)
child2 parent of this child2 parent of the account on the left
etc... (until the highest level)
child3 parent of this child3 parent of the account on the left
etc... (until the highest level)
child4 parent of this child4 parent of the account on the left
etc... (until the highest level)
child5 parent of this child5 parent of the account on the left
etc... (until the highest level)
child6 parent of this child6 parent of the account on the left
etc... (until the highest level)
child7 parent of this child7 parent of the account on the left
etc... (until the highest level)
child8 parent of this child8 parent of the account on the left
etc... (until the highest level)
child9 parent of this child9 parent of the account on the left
etc... (until the highest level)
....
childn parent of this childn parent of the account on the left
etc... (until the highest level)

I have more than 3000 rows and 15 columns (=levels) of this three-like
structure... (some rows have 15 levels, some others finish as early as
after
4 levels, then it's blank)
Based on this, I would like to convert it into an accounting-like scheme
(f.
ex. column A = accounts; column B = amounts (or SUM formulas where
appropriate)):

child1
child2
child3
Parent of these 3 child accounts (formatted differently (level 1 parent))
(=SUM of all the relevant childs)
child4
child5
Parent of these 2 accounts (formatted level 1 parent) (=SUM of all the
relevant childs)
Parent of both parents above... (formatted level 2 parents) (=SUM of all
the
relevant parents level 1)
etc... (until the end)

Of course if any other structure is easier to achieve (and will make the
same job, i.e. to recreate balance-sheet structure), I'm open to all
suggestions...
Many thanks in advance for any comments on this!

Regards,
Mark





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default convert multicolumn/multirow table into two structured/formatt

I still need clrification. If you have

A B C D E F G

What do you want in A - C?
for example
A B C
B C D
C D E
E F G

or maybe just
A B G

I can't tell from your instructions how you want me to split the A - G
columns. Any way is very easy for me. I've done it a hundred times before
and I know that it can be done many many many diffferent ways. I just want
to do it the way you need it done.


"markx" wrote:

Hi Joel,
Many thanks for your involvement and quick answer!

I've tried your macro and unfortunately the problem is more complex than
this... :-(
Probably I haven't made myself sufficiently clear...

The data (account names) are already in area A1:N3100. The problem is that
for some accounts it will take, let's say, sevel levels to arrive to the
top/final parent account "Total Assets", and for others, they will need only
2 levels to get there. So, in one row columns A to G will be filled in
(child1=its parent=parent's parent=...="Total assets" account), and in
another, we'll have only columns A to C filled in (child1=its
parent=immediately "Total assets" account). You see? So, we can have the
same account name in several different columns, everything depends of the
depth of a particular asset class.

Second thing is that I don't have the amounts in this table for the moment,
only account names (then, once I arrive to have the accounts structured in
only one column (with the subtotals etc...), I'll add the extraction formula
from external database for every child account (for this, I know how to deal
with...) to the column next to it: so, in column A i plan to have all the
account names, and in column B I'll have the amounts extracted, except for
the subtotals (=parent accounts).

Sorry if I wasn't sufficiently explicit before...
Mark

"Joel" wrote in message
...
I think this was real easy.
I moved the 3 column data to columns A - c. then I sorted on column c as
first Key and column B as 2nd key. next I compared column b to determine
where each parentt acount started and end. Then I put the sum of the
parents
account in column d.


let me know if I'm right or what modification are required.

Sub refomtchild()

RowCount = 1
Do While Cells(RowCount, "A") < ""
If Not IsEmpty(Cells(RowCount, "E")) Then
Rows(RowCount + 1).Insert
LastCol = Cells(RowCount, Columns.Count). _
End(xlToLeft).Column
Set cutrange = Range(Cells(RowCount, "D"), _
Cells(RowCount, LastCol))
cutrange.Cut Destination:=Cells(RowCount + 1, "A")
End If
RowCount = RowCount + 1
Loop

'sort by parent then child
Range("A2:C" & (RowCount - 1)).Sort _
Key1:=Range("C2"), _
Order1:=xlAscending, _
Key2:=Range("B2"), _
Order2:=xlAscending, _
Header:=xlGuess



'put in subtotals
RowCount = 1

StartRow = 1
Do While Cells(RowCount, "A") < ""
If Cells(RowCount, "B") < Cells(RowCount + 1, "B") Then
Cells(RowCount, "D").Formula = "=Sum(A" & StartRow & _
":A" & RowCount & ")"
StartRow = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End Sub


"markx" wrote:

Hi all,

I know this is an extremely tough one and I don't expect here any final
answer on this - some enlightening guidelines (f. ex. if it's
feasible...)
would be already great!

I have a huge excel table (database) that involves child (unique) and
parent
(not unique) accounts and is constructed like this:

A B C
D,E,F etc...
child1 parent of this child1 parent of the account on the left
etc... (until the highest level)
child2 parent of this child2 parent of the account on the left
etc... (until the highest level)
child3 parent of this child3 parent of the account on the left
etc... (until the highest level)
child4 parent of this child4 parent of the account on the left
etc... (until the highest level)
child5 parent of this child5 parent of the account on the left
etc... (until the highest level)
child6 parent of this child6 parent of the account on the left
etc... (until the highest level)
child7 parent of this child7 parent of the account on the left
etc... (until the highest level)
child8 parent of this child8 parent of the account on the left
etc... (until the highest level)
child9 parent of this child9 parent of the account on the left
etc... (until the highest level)
....
childn parent of this childn parent of the account on the left
etc... (until the highest level)

I have more than 3000 rows and 15 columns (=levels) of this three-like
structure... (some rows have 15 levels, some others finish as early as
after
4 levels, then it's blank)
Based on this, I would like to convert it into an accounting-like scheme
(f.
ex. column A = accounts; column B = amounts (or SUM formulas where
appropriate)):

child1
child2
child3
Parent of these 3 child accounts (formatted differently (level 1 parent))
(=SUM of all the relevant childs)
child4
child5
Parent of these 2 accounts (formatted level 1 parent) (=SUM of all the
relevant childs)
Parent of both parents above... (formatted level 2 parents) (=SUM of all
the
relevant parents level 1)
etc... (until the end)

Of course if any other structure is easier to achieve (and will make the
same job, i.e. to recreate balance-sheet structure), I'm open to all
suggestions...
Many thanks in advance for any comments on this!

Regards,
Mark






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default convert multicolumn/multirow table into two structured/formatt

Hi Joel,

That's the difficulty - I don't want to simply split the columns, but create
two columns based on relations in the initial table:

So, if simplified, I have f.ex. the following table (only account numbers,
no amounts), where the parent account is always on the right (B1 parent of
A1, C1 parent of B1, and the highest level account is D1 (=no parent account
on the right side next to it):

A1 B1 C1 D1
A2 B1 C1 D1
A3 B1 C1 D1
A4 B2 C1 D1
A5 B2 C1 D1
A6 B3 D1
A7 B3 D1
A8 B3 D1
A9 D1
A10 C1 D1
B1 C1 D1
B2 C1 D1
B3 D1
C1 D1
C2 D1

What I want to achieve is (based on the relationships above) to have, on
another worksheet, in the first column structured listing of all the
accounts (A1...D1), and in the second column (next to it) the adequate
formulas for all the parent accounts (always SUMs), as below:

A1
A2
A3
B1 (=A1+A2+A3)
A4
A5
B2 (=A4+A5)
A6
A7
A8
A9
B3 (=A6+A7+A8)
A10
C1 (=B1+B2+A10)
C2
D1 (=A9+B3+C1+C2)

Still easy :-)?



"Joel" wrote in message
...
I still need clrification. If you have

A B C D E F G

What do you want in A - C?
for example
A B C
B C D
C D E
E F G

or maybe just
A B G

I can't tell from your instructions how you want me to split the A - G
columns. Any way is very easy for me. I've done it a hundred times
before
and I know that it can be done many many many diffferent ways. I just
want
to do it the way you need it done.


"markx" wrote:

Hi Joel,
Many thanks for your involvement and quick answer!

I've tried your macro and unfortunately the problem is more complex than
this... :-(
Probably I haven't made myself sufficiently clear...

The data (account names) are already in area A1:N3100. The problem is
that
for some accounts it will take, let's say, sevel levels to arrive to the
top/final parent account "Total Assets", and for others, they will need
only
2 levels to get there. So, in one row columns A to G will be filled in
(child1=its parent=parent's parent=...="Total assets" account), and
in
another, we'll have only columns A to C filled in (child1=its
parent=immediately "Total assets" account). You see? So, we can have the
same account name in several different columns, everything depends of the
depth of a particular asset class.

Second thing is that I don't have the amounts in this table for the
moment,
only account names (then, once I arrive to have the accounts structured
in
only one column (with the subtotals etc...), I'll add the extraction
formula
from external database for every child account (for this, I know how to
deal
with...) to the column next to it: so, in column A i plan to have all the
account names, and in column B I'll have the amounts extracted, except
for
the subtotals (=parent accounts).

Sorry if I wasn't sufficiently explicit before...
Mark

"Joel" wrote in message
...
I think this was real easy.
I moved the 3 column data to columns A - c. then I sorted on column c
as
first Key and column B as 2nd key. next I compared column b to
determine
where each parentt acount started and end. Then I put the sum of the
parents
account in column d.


let me know if I'm right or what modification are required.

Sub refomtchild()

RowCount = 1
Do While Cells(RowCount, "A") < ""
If Not IsEmpty(Cells(RowCount, "E")) Then
Rows(RowCount + 1).Insert
LastCol = Cells(RowCount, Columns.Count). _
End(xlToLeft).Column
Set cutrange = Range(Cells(RowCount, "D"), _
Cells(RowCount, LastCol))
cutrange.Cut Destination:=Cells(RowCount + 1, "A")
End If
RowCount = RowCount + 1
Loop

'sort by parent then child
Range("A2:C" & (RowCount - 1)).Sort _
Key1:=Range("C2"), _
Order1:=xlAscending, _
Key2:=Range("B2"), _
Order2:=xlAscending, _
Header:=xlGuess



'put in subtotals
RowCount = 1

StartRow = 1
Do While Cells(RowCount, "A") < ""
If Cells(RowCount, "B") < Cells(RowCount + 1, "B") Then
Cells(RowCount, "D").Formula = "=Sum(A" & StartRow & _
":A" & RowCount & ")"
StartRow = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End Sub


"markx" wrote:

Hi all,

I know this is an extremely tough one and I don't expect here any
final
answer on this - some enlightening guidelines (f. ex. if it's
feasible...)
would be already great!

I have a huge excel table (database) that involves child (unique) and
parent
(not unique) accounts and is constructed like this:

A B C
D,E,F etc...
child1 parent of this child1 parent of the account on the left
etc... (until the highest level)
child2 parent of this child2 parent of the account on the left
etc... (until the highest level)
child3 parent of this child3 parent of the account on the left
etc... (until the highest level)
child4 parent of this child4 parent of the account on the left
etc... (until the highest level)
child5 parent of this child5 parent of the account on the left
etc... (until the highest level)
child6 parent of this child6 parent of the account on the left
etc... (until the highest level)
child7 parent of this child7 parent of the account on the left
etc... (until the highest level)
child8 parent of this child8 parent of the account on the left
etc... (until the highest level)
child9 parent of this child9 parent of the account on the left
etc... (until the highest level)
....
childn parent of this childn parent of the account on the left
etc... (until the highest level)

I have more than 3000 rows and 15 columns (=levels) of this three-like
structure... (some rows have 15 levels, some others finish as early as
after
4 levels, then it's blank)
Based on this, I would like to convert it into an accounting-like
scheme
(f.
ex. column A = accounts; column B = amounts (or SUM formulas where
appropriate)):

child1
child2
child3
Parent of these 3 child accounts (formatted differently (level 1
parent))
(=SUM of all the relevant childs)
child4
child5
Parent of these 2 accounts (formatted level 1 parent) (=SUM of all the
relevant childs)
Parent of both parents above... (formatted level 2 parents) (=SUM of
all
the
relevant parents level 1)
etc... (until the end)

Of course if any other structure is easier to achieve (and will make
the
same job, i.e. to recreate balance-sheet structure), I'm open to all
suggestions...
Many thanks in advance for any comments on this!

Regards,
Mark










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default convert multicolumn/multirow table into two structured/formatt

iT JUST KEEPS ON GETTING EASIER ALL THE TIME.

questions:
1)exactly what do you want me to put in the cell for

(=A4+A5)
A4 and A5 are names not numbers!

2) Should the results in one abovve be an amount or a formula.
3) The break down you show is only on column B. Is ther additional break
down on other columns.
4) Can I get the amonts from the last column on each row?

"markx" wrote:

Hi Joel,

That's the difficulty - I don't want to simply split the columns, but create
two columns based on relations in the initial table:

So, if simplified, I have f.ex. the following table (only account numbers,
no amounts), where the parent account is always on the right (B1 parent of
A1, C1 parent of B1, and the highest level account is D1 (=no parent account
on the right side next to it):

A1 B1 C1 D1
A2 B1 C1 D1
A3 B1 C1 D1
A4 B2 C1 D1
A5 B2 C1 D1
A6 B3 D1
A7 B3 D1
A8 B3 D1
A9 D1
A10 C1 D1
B1 C1 D1
B2 C1 D1
B3 D1
C1 D1
C2 D1

What I want to achieve is (based on the relationships above) to have, on
another worksheet, in the first column structured listing of all the
accounts (A1...D1), and in the second column (next to it) the adequate
formulas for all the parent accounts (always SUMs), as below:

A1
A2
A3
B1 (=A1+A2+A3)
A4
A5
B2 (=A4+A5)
A6
A7
A8
A9
B3 (=A6+A7+A8)
A10
C1 (=B1+B2+A10)
C2
D1 (=A9+B3+C1+C2)

Still easy :-)?



"Joel" wrote in message
...
I still need clrification. If you have

A B C D E F G

What do you want in A - C?
for example
A B C
B C D
C D E
E F G

or maybe just
A B G

I can't tell from your instructions how you want me to split the A - G
columns. Any way is very easy for me. I've done it a hundred times
before
and I know that it can be done many many many diffferent ways. I just
want
to do it the way you need it done.


"markx" wrote:

Hi Joel,
Many thanks for your involvement and quick answer!

I've tried your macro and unfortunately the problem is more complex than
this... :-(
Probably I haven't made myself sufficiently clear...

The data (account names) are already in area A1:N3100. The problem is
that
for some accounts it will take, let's say, sevel levels to arrive to the
top/final parent account "Total Assets", and for others, they will need
only
2 levels to get there. So, in one row columns A to G will be filled in
(child1=its parent=parent's parent=...="Total assets" account), and
in
another, we'll have only columns A to C filled in (child1=its
parent=immediately "Total assets" account). You see? So, we can have the
same account name in several different columns, everything depends of the
depth of a particular asset class.

Second thing is that I don't have the amounts in this table for the
moment,
only account names (then, once I arrive to have the accounts structured
in
only one column (with the subtotals etc...), I'll add the extraction
formula
from external database for every child account (for this, I know how to
deal
with...) to the column next to it: so, in column A i plan to have all the
account names, and in column B I'll have the amounts extracted, except
for
the subtotals (=parent accounts).

Sorry if I wasn't sufficiently explicit before...
Mark

"Joel" wrote in message
...
I think this was real easy.
I moved the 3 column data to columns A - c. then I sorted on column c
as
first Key and column B as 2nd key. next I compared column b to
determine
where each parentt acount started and end. Then I put the sum of the
parents
account in column d.


let me know if I'm right or what modification are required.

Sub refomtchild()

RowCount = 1
Do While Cells(RowCount, "A") < ""
If Not IsEmpty(Cells(RowCount, "E")) Then
Rows(RowCount + 1).Insert
LastCol = Cells(RowCount, Columns.Count). _
End(xlToLeft).Column
Set cutrange = Range(Cells(RowCount, "D"), _
Cells(RowCount, LastCol))
cutrange.Cut Destination:=Cells(RowCount + 1, "A")
End If
RowCount = RowCount + 1
Loop

'sort by parent then child
Range("A2:C" & (RowCount - 1)).Sort _
Key1:=Range("C2"), _
Order1:=xlAscending, _
Key2:=Range("B2"), _
Order2:=xlAscending, _
Header:=xlGuess



'put in subtotals
RowCount = 1

StartRow = 1
Do While Cells(RowCount, "A") < ""
If Cells(RowCount, "B") < Cells(RowCount + 1, "B") Then
Cells(RowCount, "D").Formula = "=Sum(A" & StartRow & _
":A" & RowCount & ")"
StartRow = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End Sub


"markx" wrote:

Hi all,

I know this is an extremely tough one and I don't expect here any
final
answer on this - some enlightening guidelines (f. ex. if it's
feasible...)
would be already great!

I have a huge excel table (database) that involves child (unique) and
parent
(not unique) accounts and is constructed like this:

A B C
D,E,F etc...
child1 parent of this child1 parent of the account on the left
etc... (until the highest level)
child2 parent of this child2 parent of the account on the left
etc... (until the highest level)
child3 parent of this child3 parent of the account on the left
etc... (until the highest level)
child4 parent of this child4 parent of the account on the left
etc... (until the highest level)
child5 parent of this child5 parent of the account on the left
etc... (until the highest level)
child6 parent of this child6 parent of the account on the left
etc... (until the highest level)
child7 parent of this child7 parent of the account on the left
etc... (until the highest level)
child8 parent of this child8 parent of the account on the left
etc... (until the highest level)
child9 parent of this child9 parent of the account on the left
etc... (until the highest level)
....
childn parent of this childn parent of the account on the left
etc... (until the highest level)

I have more than 3000 rows and 15 columns (=levels) of this three-like
structure... (some rows have 15 levels, some others finish as early as
after
4 levels, then it's blank)
Based on this, I would like to convert it into an accounting-like
scheme
(f.
ex. column A = accounts; column B = amounts (or SUM formulas where
appropriate)):

child1
child2
child3
Parent of these 3 child accounts (formatted differently (level 1
parent))
(=SUM of all the relevant childs)
child4
child5
Parent of these 2 accounts (formatted level 1 parent) (=SUM of all the
relevant childs)
Parent of both parents above... (formatted level 2 parents) (=SUM of
all
the
relevant parents level 1)
etc... (until the end)

Of course if any other structure is easier to achieve (and will make
the
same job, i.e. to recreate balance-sheet structure), I'm open to all
suggestions...
Many thanks in advance for any comments on this!

Regards,
Mark









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
I need to convert a table of data to columns only Pranjali Excel Discussion (Misc queries) 1 February 10th 09 07:08 AM
VLOOKUP with Structured Reference to Table Header Julien Bouvier Excel Worksheet Functions 4 December 18th 08 11:34 PM
How to convert formatted date into text. Ks DRM Excel Worksheet Functions 6 April 12th 08 12:08 AM
Convert a formatted table back to a list marcopolo Excel Discussion (Misc queries) 0 March 20th 08 03:08 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 09:53 AM.

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

About Us

"It's about Microsoft Excel"