0

I have data that looks like this:

Group: Class:   Value:
A          1        51
A          2        60
B          1        55
B          2        67
B          3        70
C          1        53
C          3        65

Need the data to look like this:

Group:             1:           2:            3: 
    A             51            60             0
    B             55            67            70
    C             53             0            65

The code I am trying is doing two things wrong: 1. Skipping rows 2. not matching value to class column which causes an issue for Group C since it puts the 65 value into class 2 not and not in class 3 for the final row (row 3 in this example).
=IFERROR(IF(AND($B2=1,COLUMN()<3+MATCH($B2,$B3:$B11000,0)),OFFSET(B2,COLUMN()-3,2-COLUMN()),""),"")

2 Answers 2

1

This has worked for me.Hope it helps!

=SUMPRODUCT(($A$2:$A$8=$E2)*($B$2:$B$8=COLUMN(A:A))*$C$2:$C$8)

enter image description here

If the C column format is text, let's try:

=IFERROR(OFFSET($C$2,MATCH(1,INDEX(($A$2:$A$8=$E2)*($B$2:$B$8=COLUMN(A$1)),),0)-1,),"")

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

I think it's more efficient to use PivotTable for such tasks:

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.