LEFT(B27:B42,3) | Extracts 1st Three character from B27:B42 and forms an array of string.Ex. "aaa","bbb","xxx"...
(LEFT(B27:B42,3)="xxx") | Compares the above array with string xxx.If it is xxx then it is returned TRUE, Otherwise FALSE.So the new array is FALSE,FALSE,TRUE... for above array
(--(LEFT(B27:B42,3)="xxx") | Converts the TRUE/FALSE to 1 or 0 by double negation.It is just done to force conversion to number.You can use (LEFT(B27:B42,3)="xxx")*1 . The new array is 0,0,1...
=SUMPRODUCT(--(LEFT(B27:B42,3)="xxx"),D27:D42) | Multiplied with corresponding value of D27:D42 and sums all result.So calculation is SUM( D27 * 0 , D28*0,D29*1....)
I assumed in B27,B28,B29 the first thre char is "aaa","bbb","xxx" and tried to explain with the example.
Hope it helps.