close

I have a database report which has been exported into Excel. I want to
rearrange the presentation of the data. Currently the data is presented as
follows:

COSTCENTRE1ACCOUNT CODE 1VALUE
COSTCENTRE1ACCOUNT CODE 2VALUE
COSTCENTRE1ACCOUNT CODE 3VALUE
COSTCENTRE2ACCOUNT CODE 1VALUE
COSTCENTRE2ACCOUNT CODE 2VALUE
COSTCENTRE3ACCOUNT CODE 1VALUE
COSTCENTRE3ACCOUNT CODE 2VALUE
COSTCENTRE3ACCOUNT CODE 3VALUE

Note: Each cost centre may have up to three account codes.

I would like to present the data like this:

ACCOUNT CODE 1 ACCOUNT CODE 2ACCOUNT CODE 3
COSTCENTRE1VALUE VALUE VALUE
COSTCENTRE2VALUE VALUE
COSTCENTRE3VALUE VALUE VALUE

How can this be done on Excel?

Thanks.Are these values numeric?

If yes, then you can use a pivottable.

Add a single row of headers to your range.

Select that range (include the header row)

Data|pivottable
follow the wizard until you get to the step with a Layout button.
Click that button
Drag the costcenter header button to the row field
drag the accountcode header button to the column field
drag the value header button to the data field
(if you see quot;Count of Valuequot;, then double click on that button and change it to
Sum)

And finish up.

This will only work if the values are numeric.Pete wrote:
gt;
gt; I have a database report which has been exported into Excel. I want to
gt; rearrange the presentation of the data. Currently the data is presented as
gt; follows:
gt;
gt; COSTCENTRE1 ACCOUNT CODE 1 VALUE
gt; COSTCENTRE1 ACCOUNT CODE 2 VALUE
gt; COSTCENTRE1 ACCOUNT CODE 3 VALUE
gt; COSTCENTRE2 ACCOUNT CODE 1 VALUE
gt; COSTCENTRE2 ACCOUNT CODE 2 VALUE
gt; COSTCENTRE3 ACCOUNT CODE 1 VALUE
gt; COSTCENTRE3 ACCOUNT CODE 2 VALUE
gt; COSTCENTRE3 ACCOUNT CODE 3 VALUE
gt;
gt; Note: Each cost centre may have up to three account codes.
gt;
gt; I would like to present the data like this:
gt;
gt; ACCOUNT CODE 1 ACCOUNT CODE 2 ACCOUNT CODE 3
gt; COSTCENTRE1 VALUE VALUE VALUE
gt; COSTCENTRE2 VALUE VALUE
gt; COSTCENTRE3 VALUE VALUE VALUE
gt;
gt; How can this be done on Excel?
gt;
gt; Thanks.

--

Dave Peterson

I mocked up your current data's format into cells A1:C8. In F1, G1,
and H1 I entered your ACCOUNT CODE headers; in E2, E3, and E4 I entered
row labels (CostCentre1 etc). In cell F2 I entered this formula
=SUMPRODUCT(--($E2=$A$1:$A$8),--(F$1=$B$1:$B$8),$C$1:$C$8)
.... which you can copy and paste into the other cells in that grid.

This formula returns a zero for COSTCENTRE2/ACCOUNT CODE 3. If you
desire you can revise the formula with an IF that enters a blank when
the value is zero, or you can conditionally format the cells with white
font when the value is zero.Guys, thanks very much for your help. I've tried doing as instructed and
these PivotTables will do the job. Unfortunately at the moment it's reporting
the wrong values, but I'm sure with a bit of playing a round I'll get it
sussed.

Thanks again,
Pete

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()