# Multiple Rolling Excel Sumifs

**URL:** <https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496>\
**Category:** KNIME Analytics Platform\
**Created:** [March 15, 2021, 6:58pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496 "2021-03-15T18:58:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DataWing](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@DataWing](https://forum.knime.com/u/DataWing)\
**Post date:** [March 15, 2021, 6:58pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/1 "2021-03-15T18:58:32Z")

</div>

Hi-  
I’m somewhat new to Knime and have hit a wall. I’m trying to use Knime to do what I can do in Excel. I want to calculate SUMIFS based on multiple criteria.

Criteria to use:  
Customer #  
Product Code

I want to calculate trailing 30 day stockouts based on Customer/Product/Date.

I’ve looked at multiple examples of group by, column aggregator or loops and I can’t seem to figure this out.

I’ve attached an example of the data as well as the desired outcome.

Thanks for any help. [Share.xlsx](https://forum.knime.com/uploads/short-url/zRZikYS3IATH5tTaAlZ7Z6uCS1N.xlsx) (14.5 KB)

---

<div class="post-metadata">

**Author:** ![marten\_kose](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/a87d85/32.png) [@marten\_kose](https://forum.knime.com/u/marten_kose)\
**Post date:** [March 17, 2021, 9:19am UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/2 "2021-03-17T09:19:01Z")

</div>

Question on SUMIF came up a couple of times in the forum. @ipazin created an example for this and shared it in this thread: [Sumifs Excel - #14 by ipazin](https://forum.knime.com/t/sumifs-excel/13710/14)

@elsamuel also provided an example for this: [Sumif and Conditional formatting ideas - #2 by elsamuel](https://forum.knime.com/t/sumif-and-conditional-formatting-ideas/30962/2)

---

<div class="post-metadata">

**Author:** ![DataWing](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@DataWing](https://forum.knime.com/u/DataWing)\
**Post date:** [March 17, 2021, 3:39pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/3 "2021-03-17T15:39:39Z")

</div>

Thank You @Marten_Pfannenschmidt for the example workflow. Where I am getting stuck is the Sum IFS to sum between dates. I’ve attached a sample workflow that I was using to achieve this, however its resulting in an empty table.

OR

Does this need to be setup with a rule based filter within a loop?

[Sumifs Example.knwf](https://forum.knime.com/uploads/short-url/7yDX52VKlv9ZBD7OdboyY5273jm.knwf) (19.2 KB)

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [March 17, 2021, 6:40pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/4 "2021-03-17T18:40:35Z")

</div>

you compare ticket date \< ticket date so basically the cell value with itself. This can never be true

---

<div class="post-metadata">

**Author:** ![DataWing](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@DataWing](https://forum.knime.com/u/DataWing)\
**Post date:** [March 17, 2021, 8:45pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/5 "2021-03-17T20:45:38Z")

</div>

@Daniel_Weikert, Understood, but how would one do a sumif based on a date range?

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 18, 2021, 10:24am UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/6 "2021-03-18T10:24:26Z")

</div>

Hello @DataWing,

and welcome to KNIME Community!

You should loop over your criteria (use [Group Loop Start](https://kni.me/n/7a8fxq51Z1jrgXeM) node to define grouping columns) and in each iteration perform your calculation. Check workflow example where I got your desired outcome. Though not sure I got your logic with dates properly.  
[Sumifs Example\_ipazin.knwf](https://forum.knime.com/uploads/short-url/bzySbpdVC0vqfjBq1KPPr1irOnT.knwf) (40.6 KB)

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![DataWing](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@DataWing](https://forum.knime.com/u/DataWing)\
**Post date:** [March 19, 2021, 5:04am UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/7 "2021-03-19T05:04:59Z")

</div>

Hi @ipazin-  
Thank you so much for the help! Your workflow is a big help! But I am still not able to get the desired outcome based on the date logic.

Date Logic: Trying to sum the Stock Out column based on Prior 30 days from date of “TicketDate” by Customer/Product.

I re-did my work flow based on your logic, but still not able to calc the prior 30 days. For example, see excel file.

Example:  
For Customer 4680 on Ticket Date 4/7/2021, the trailing 30 day range is until 3/8/2021. So therefore the Prior 30 Day Stock out should be 1. Current Knime workflow is still calc 4.

[share export1.xlsx](https://forum.knime.com/uploads/short-url/2nFWgJlaOJ1n2orImCjvLJ3MPNW.xlsx) (12.7 KB)  
[Sumifs Example\_rework.knwf](https://forum.knime.com/uploads/short-url/3zMeXNyY3eYmL08YVlDZno0Fyl1.knwf) (31.7 KB)

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 22, 2021, 11:18am UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/8 "2021-03-22T11:18:19Z")

</div>

Hello @DataWing,

then seems you need to go row by row, filter one month data based on it and sum it. Check out workflow attached:  
[Sumifs Example\_rework\_ipazin.knwf](https://forum.knime.com/uploads/short-url/3b9Dyg0wVKbVGFjNminxZAUEzBM.knwf) (83.2 KB)

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![DataWing](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/dc4da7/32.png) [@DataWing](https://forum.knime.com/u/DataWing)\
**Post date:** [March 24, 2021, 3:39pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/9 "2021-03-24T15:39:46Z")

</div>

Thanks @ipazin. This worked for me. I was also able to learn a lot through your workflow as well.

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 24, 2021, 3:45pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/10 "2021-03-24T15:45:08Z")

</div>

Glad to hear that @DataWing 🙂  
Ivan

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [March 31, 2021, 3:45pm UTC](https://forum.knime.com/t/multiple-rolling-excel-sumifs/31496/11 "2021-03-31T15:45:39Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
