Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Carsten
 
Posts: n/a
Default arrays and pivot table

I have a worksheet in the following format:


January February March
April
Salesman A Product A 22 11 3
6
Salesman B Product A 2 33 5
3
Salesman B Product B 6 4 6
7

I'd like to use a pivotable on this.
To do that I am trying to convert the above into something like

Salesman A Product A January 2
Salesman B Product A January 3
Salesman B Product B February 4
etc.

Now first of all, am I going the wrong way about this or is there a way of
getting the pivottable from the fist array. If not, how do I convert the
first array into the second.

Cheers,

Carsten



  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Carsten" wrote...
I have a worksheet in the following format:

January February March April
Salesman A Product A 22 11 3 6
Salesman B Product A 2 33 5 3
Salesman B Product B 6 4 6 7

I'd like to use a pivotable on this.
To do that I am trying to convert the above into something like

Salesman A Product A January 2
Salesman B Product A January 3
Salesman B Product B February 4
etc.


You can't use a pivot table to do this. It looks like you want to
un-crosstab, but your sample result doesn't match your sample original data
(the only 3 in input is for Salesman A Product A in March, not Salesman B
Product A in January).

To un-crosstab, if the original data were in a range named XTab including
the row with the month names at the top, and the top-left result cell were
A7, try the following formulas.

A7:
=INDEX(XTab,INT((ROWS(A$7:A7)-1)/4)+2,1)

B7:
=INDEX(XTab,INT((ROWS(B$7:B7)-1)/4)+2,2)

C7:
=INDEX(XTab,1,MOD(ROWS(C$7:C7)-1,4)+3)

D7:
=INDEX(XTab,INT((ROWS(B$7:B7)-1)/4)+2,MOD(ROWS(D$7:D7)-1,4)+3)

Fill A7:D7 down as far as needed. When you've exhausted the original data,
the formulas in columns A, B and D will return #REF! errors.

This will product a table in the original salesman and product order, not
sorted by month. If you want it sorted by month, select the entire result
range, copy it, then paste special as values on top of itself, and sort it
by the month column (C).


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
Calculating % in a pivot table David Excel Worksheet Functions 1 March 13th 05 12:48 PM


All times are GMT +1. The time now is 04:02 PM.

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"