マクロの例です。
倉庫と品種ごとに集計しています。
品種にカタカナ(例えばリンゴ)とひらがな(例えばりんご)が混在していても、各品種で最初に現れた品種名で集計しています。
Sub sample()
Dim lastrow As Long, i As Long, n As Long
Dim rngtmp As Range, rng数 As Range, rng番号 As Range
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 5 To lastrow
n = 0
Do While Cells(i + n, "B") = Cells(i + n + 1, "B") And _
StrConv(Cells(i + n, "C"), vbKatakana + vbWide) = StrConv(Cells(i + n + 1, "C"), vbKatakana + vbWide)
Cells(i + n + 1, "A") = Cells(i + n, "A")
n = n + 1
Loop
i = i + n
Next
Set rngtmp = Range("E5:E" & lastrow)
Set rng数 = Range("D5:D" & lastrow)
Set rng番号 = Range("A5:A" & lastrow)
rngtmp.Formula = _
"=IF(COUNTIF($A$5:A5,A5)=1,SUMIFS(" & rng数.Address & "," & rng番号.Address & ",A5),"""")"
rng数.Value = rngtmp.Value
rngtmp.ClearContents
For i = lastrow To 5 Step -1
If Cells(i, "D") = "" Then
Range(Cells(i, "A"), Cells(i, "D")).Delete
End If
Next
Range("A5") = 1
Range("A5", Cells(Rows.Count, "A").End(xlUp)).DataSeries _
Rowcol:=xlColumns, Type:=xlLinear, Step:=1
End Sub