Hello,
I have a formula on one Sheet that looks in row B4:Q4 on another Sheet, for the cell If it equals the string "KG" then it Sumifs that Range of Rows 5:1000 for the criteria range in A5:A1000 and criteria in A2:
e.g. If H4 = "KG" then Sumifs range:A5:A1000 criteria: A2 sum_range: H5:H1000
The formula works, but it is a very long formula:
=IF('Paul Verdeling'!B4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!B5:B1000),IF('Paul Verdeling'!C4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!C5:C1000),IF('Paul Verdeling'!D4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!D5:D1000),IF('Paul Verdeling'!E4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!E5:E1000),IF('Paul Verdeling'!F4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!F5:F1000),IF('Paul Verdeling'!G4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!G5:G1000),IF('Paul Verdeling'!H4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!H5:H1000),IF('Paul Verdeling'!I4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!I5:I1000),IF('Paul Verdeling'!J4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!J5:J1000),IF('Paul Verdeling'!K4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!K5:K1000),IF('Paul Verdeling'!L4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!L5:L1000),IF('Paul Verdeling'!M4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!M5:M1000),IF('Paul Verdeling'!N4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!N5:N1000),IF('Paul Verdeling'!O4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!O5:O1000),IF('Paul Verdeling'!P4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!P5:P1000),IF('Paul Verdeling'!Q4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!Q5:Q1000),"GEEN KG"))))))))))))))))
Is there a way to make it shorter?
I have a formula on one Sheet that looks in row B4:Q4 on another Sheet, for the cell If it equals the string "KG" then it Sumifs that Range of Rows 5:1000 for the criteria range in A5:A1000 and criteria in A2:
e.g. If H4 = "KG" then Sumifs range:A5:A1000 criteria: A2 sum_range: H5:H1000
The formula works, but it is a very long formula:
=IF('Paul Verdeling'!B4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!B5:B1000),IF('Paul Verdeling'!C4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!C5:C1000),IF('Paul Verdeling'!D4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!D5:D1000),IF('Paul Verdeling'!E4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!E5:E1000),IF('Paul Verdeling'!F4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!F5:F1000),IF('Paul Verdeling'!G4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!G5:G1000),IF('Paul Verdeling'!H4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!H5:H1000),IF('Paul Verdeling'!I4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!I5:I1000),IF('Paul Verdeling'!J4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!J5:J1000),IF('Paul Verdeling'!K4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!K5:K1000),IF('Paul Verdeling'!L4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!L5:L1000),IF('Paul Verdeling'!M4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!M5:M1000),IF('Paul Verdeling'!N4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!N5:N1000),IF('Paul Verdeling'!O4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!O5:O1000),IF('Paul Verdeling'!P4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!P5:P1000),IF('Paul Verdeling'!Q4="KG",SUMIF('Paul Verdeling'!A5:A1000,'Sundried Verdeling'!A2,'Paul Verdeling'!Q5:Q1000),"GEEN KG"))))))))))))))))
Is there a way to make it shorter?