# I am trying to calculate based off my excel formula for CTM but I just end up with zeros

**URL:** <https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637>\
**Category:** Q&A\
**Tags:** calculations, Business-Intelligence-Engineer, quick-sight\
**Created:** [January 7, 2025, 9:35pm UTC](https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637 "2025-01-07T21:35:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcskylar](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mcskylar](https://community.amazonquick.com/u/mcskylar)\
**Post date:** [January 7, 2025, 9:35pm UTC](https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637/1 "2025-01-07T21:35:22Z")

</div>

So I have this excel formula:  
`=(((total_compliant_qty_confirmed+[@[Not Compliant]])/total_qty_confirmed)-overall_compliace)*10000`

And I tried to transition it into a quicksight formula:

```auto
(
    (
        (
        {Total Compliant Units}+sumOver(sumIf({Total Qty Confirmed}, Status <> "Complaint"), [Manufacturer])
        )
    / sum({Total Qty Confirmed})
    ) 
- Compliance
)*10000

```

But I just end up with crazy numbers, I broke down each section to get the overall formula but still doesn’t work

---

<div class="post-metadata">

**Author:** ![Giridhar.Prabhu](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/giridhar.prabhu/32/27789_2.png) [@Giridhar.Prabhu](https://community.amazonquick.com/u/Giridhar.Prabhu)\
**Post date:** [January 8, 2025, 5:02am UTC](https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637/2 "2025-01-08T05:02:56Z")

</div>

Your SumOver grouped by Manufacturer seems different from your excel formula.

Please share some sample details of your excel data and the same from what you see in Quick Sight. It would be easy to answer then

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [January 8, 2025, 5:10am UTC](https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637/3 "2025-01-08T05:10:03Z")

</div>

Hi @mcskylar

Error in your calculation indicates a mix of aggregated and non-aggregated fields in your formula. To resolve this issue, we need to refactor the formula to ensure that all components are either fully aggregated or non-aggregated.

Please try the following calculated field.

**Example: Replace the fields from your dataset**

```auto
(
    (
        sum({Total Compliant Units})
        + sumIf({Total Qty Confirmed}, {Status} = "Not Compliant")
    )
    / sum({Total Qty Confirmed})
    - avg({Compliance})
) * 10000

```

---

<div class="post-metadata">

**Author:** ![Brett](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/brett/32/36494_2.png) [@Brett](https://community.amazonquick.com/u/Brett)\
**Post date:** [January 21, 2025, 10:07pm UTC](https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637/4 "2025-01-21T22:07:34Z")

</div>

Hi @mcskylar,  
It’s been awhile since we last heard from you, did you have any additional questions regarding your initial post?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!

---

<div class="post-metadata">

**Author:** ![Brett](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/brett/32/36494_2.png) [@Brett](https://community.amazonquick.com/u/Brett)\
**Post date:** [January 24, 2025, 5:30pm UTC](https://community.amazonquick.com/t/i-am-trying-to-calculate-based-off-my-excel-formula-for-ctm-but-i-just-end-up-with-zeros/40637/5 "2025-01-24T17:30:01Z")

</div>

Hi @mcskylar,  
Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!
