SUMifs returns the total sum of previous cells if the current row is empty

Gabrielle_erre

New Member
Joined
Jan 3, 2019
Messages
21
Hey, I'm new here and looking to resolve the next problem.

=SUMIFS(Tabelle2!I:I, Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")


ABC
1SKUResult of SUMIFSapplied FORMULA for B
2Black100=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")
3White100=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A3&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")
4200=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A4&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")
5200=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A5&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")

<tbody>
</tbody>

How can I modify the formula in order to have 0 or emty cell in B4 and B5 if in A4 and A5 is nothing shown?

Column A from the table is result of formula =IFERROR(INDEX(Tabelle2[SKU], MATCH(0,INDEX(COUNTIF($A$1:A25,Tabelle2[SKU]),0),0)),"")

Thanks in advance! :rolleyes:
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
try this in B2, and copy down

Code:
=IF(AND(ISFORMULA(Tabelle2!A2),LEN(Tabelle2!A2)=0,ISFORMULA(Tabelle2!A3),LEN(Tabelle2!A3)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))
 
Upvote 0
I try but the result is the same. In Tabelle2 column A I have a list of different products-colours where I have the same name as in column A in current table.
 
Last edited:
Upvote 0
are you ok to share the file on online storage, e.g google drive?
 
Upvote 0
It works now! Thank you so much! I used:

=IF(AND(ISFORMULA(A2),LEN(A2)=0,ISFORMULA(A3),LEN(A3)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))
What can I do for last row if on B6 I have the Totalsum again of B1:B5? this part :

=IF(AND(ISFORMULA(A5),LEN(A5)=0,ISFORMULA(A6),LEN(A6)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A5&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))

Now the result of B5 is again the value of the total sum from B1:B5 to the last row. I can modify something?

 
Last edited:
Upvote 0
can you explain how are the 200 in B4 & B5 calculated?

Hey, I'm new here and looking to resolve the next problem.

=SUMIFS(Tabelle2!I:I, Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")


ABC
1SKUResult of SUMIFSapplied FORMULA for B
2Black100=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")
3White100=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A3&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")
4200=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A4&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")
5200=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A5&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")

<tbody>
</tbody>

How can I modify the formula in order to have 0 or emty cell in B4 and B5 if in A4 and A5 is nothing shown?

Column A from the table is result of formula =IFERROR(INDEX(Tabelle2[SKU], MATCH(0,INDEX(COUNTIF($A$1:A25,Tabelle2[SKU]),0),0)),"")

Thanks in advance! :rolleyes:
 
Upvote 0
The number 200 from column B should be the extracted values from column I (tab2) that match the criterias. In B4 and 5 the result was the sum of B2 and B3. The frormula is working fine until the emty cells from A4 and A5, when the extraction it's not possible because I do not have other cells to be counted and no criterias.

My problem was that I wanted B4 and B5 to be 0 or not shown.

=SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A5&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*")

after using your proposal, the result is:


ABC
1SKUResult of SUMIFSapplied FORMULA for B
2Black100=IF(AND(ISFORMULA(A2),LEN(A2)=0,ISFORMULA(A3),LEN(A3)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))
3White100=IF(AND(ISFORMULA(A3),LEN(A3)=0,ISFORMULA(A4),LEN(A4)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A3&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))
4=IF(AND(ISFORMULA(A4),LEN(A4)=0,ISFORMULA(A5),LEN(A5)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A4&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))
5200=IF(AND(ISFORMULA(A5),LEN(A5)=0,ISFORMULA(A6),LEN(A6)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A5&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))

<tbody>
</tbody>

I would like that B5 result to be like B4, even if is the last one...
 
Last edited:
Upvote 0
=IF(AND(ISFORMULA(A2),LEN(A2)=0,ISFORMULA(A2),LEN(A2)=0),"",SUMIFS(Tabelle2!I:I,Tabelle2!A:A,"*"&A2&"*",Tabelle2!C:C,"*"&List_daily!$L$35&"*"))

<tbody>
</tbody>
Looks like this is working just perfect... now in column C I do not have the total sum or error values where B is ampty... Thank you AlanY!
 
Upvote 0
you're welcome
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,053
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top