I think some of your example data is incorrect, ie no 0 exists for Index 1, and Index 4 should have a value of 5 not 4.
One way, though a tad roundabout:-
Drop W2 Data underneath W1 data, and insert a column at the front, tagging each set of data with W1 or W2 as appropriate. With your data that will give a table such as this:-
Sheet Index Values
W1 1 4
W1 2 8
W1 3 2
W1 4 5
W1 5 3
W2 3 2
W2 3 5
W2 2 2
W2 5 8
Now add a 4th column, call it say Count, and assuming your column header of Count is in say cell D2, put the following formula in D3 and copy down:-
=SUMPRODUCT(--($A$3:A3=A3),--($B$3:B3=B3))
This will give you a table as follows:-
Sheet Index Data Count
W1 1 4 1
W1 2 8 1
W1 3 2 1
W1 4 5 1
W1 5 3 1
W2 3 2 1
W2 3 5 2
W2 2 2 1
W2 5 8 1
Select all the data, do Data / Pivot Table and Chart report, hit Next / Next / Finish.
Now drag:-
INDEX into the ROW fields
SHEET into the COLUMN fields
Values into the DATA field
Then drag COUNT in between the ROW fields and the DATA field.
This will give you a table as follows:-
Sum of Data2 Sheet
Index Count W1 W2
1 1 4
2 1 8 2
3 1 2 2
2 5
4 1 5
5 1 3 8
You can now copy the table and paste special as values, then delete the second column, select the entire first column from the first piece of data down and do Edit / Go To Special / Blanks. Then type = and hit the UP arrow once and hit CTRL+ENTER to enter it. This fills all the blanks in the index field with the values above.
Copy and paste special as values the first column and you are done.
You might actually prefer some of the earlier views so maybe you don't need all the steps.
Regards
Ken...........
----------------------------------------------------------------------------
![[peace] [peace] [peace]](/data/assets/smilies/peace.gif)
It's easier to beg forgiveness than ask permission
![[2thumbsup] [2thumbsup] [2thumbsup]](/data/assets/smilies/2thumbsup.gif)
----------------------------------------------------------------------------