JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I have indexed data in K1:K7 and values in L1:L7 (incl. header row)
I'd like to extract unique values from K1:K7 into column G and in column H list SUMIF values. I have the following but it returns the value for the first unique value in K2 on all rows in column H.
Can someone suggest, I think error is in red:
I have also tried:
With same incorrect result. I suspect I'm not passing arrays correctly to Evaluate but unclear how.
TIA,
Jack
I have indexed data in K1:K7 and values in L1:L7 (incl. header row)
I'd like to extract unique values from K1:K7 into column G and in column H list SUMIF values. I have the following but it returns the value for the first unique value in K2 on all rows in column H.
Can someone suggest, I think error is in red:
Rich (BB code):
Sub test()
Application.ScreenUpdating = False
With ActiveSheet
.Range("K1:K7").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Cells(1, 7), Unique:=True
With .Cells(2, 7).Offset(, 1).Resize(x - 1, 1)
.Value = Evaluate("=IF(" & .Rows & ",SUMIF($K$1:$K$7," & .Offset(, -1).Address & ", $L$1:$L$7)")
End With
End With
Application.ScreenUpdating = True
End Sub
Rich (BB code):
.Value = Evaluate("=SUMIF($K$1:$K$," & .Offset(, -1).Address & ", $L$1:$L$7)")
TIA,
Jack
Last edited: