# Totals and "Count IF" from Aggregated List

**URL:** <https://cl.desmos.com/t/totals-and-count-if-from-aggregated-list/4757>\
**Category:** Questions\
**Tags:** aggregate\
**Created:** [March 2, 2023, 2:20pm UTC](https://cl.desmos.com/t/totals-and-count-if-from-aggregated-list/4757 "2023-03-02T14:20:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katie\_Speaks](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/katie_speaks/32/4169_2.png) [@Katie\_Speaks](https://cl.desmos.com/u/Katie_Speaks)\
**Post date:** [March 2, 2023, 2:20pm UTC](https://cl.desmos.com/t/totals-and-count-if-from-aggregated-list/4757/1 "2023-03-02T14:20:56Z")

</div>

Is there a way to display:

1. The total number of inputs in an aggregated list
2. The number of inputs that meet a certain criteria, i.e. \>0

I managed to take copy someone else’s activity to create a dotplot aggregated from class data. What I would like to do next is have a 3rd screen display the two things listed above so that students can calculate proportions. My search so far has indicated it would need to be done in a graph, but I can’t figure out what the specific commands in the graph need to be.

> **[Class Dotplot for Mythbusters Yawning Activity • Activity by Katie Speaks](https://classroom.amplify.com/activity/6400a57133c5564a28e6b851)**
>
> by Katie Speaks

---

<div class="post-metadata">

**Author:** ![aknauft](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/aknauft/32/3701_2.png) [@aknauft](https://cl.desmos.com/u/aknauft)\
**Post date:** [March 2, 2023, 3:14pm UTC](https://cl.desmos.com/t/totals-and-count-if-from-aggregated-list/4757/2 "2023-03-02T15:14:26Z")

</div>

For the first one, if your aggregated list is `L` then `length(L)` gives you the total number of inputs!

In the same way you can put specific indices into square brackets and pull out individual elements from a list, you can put a condition to _filter_ the list: `L[L>0]` will be all entries of `L` where `L>0` is true. Wrap that in a `length`, and you have the number of inputs that are positive!

(Alternatively, you could straight calculate `total({L>0:1,0})`, but I’m a fan of filtering.)

---

<div class="post-metadata">

**Author:** ![Katie\_Speaks](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/katie_speaks/32/4169_2.png) [@Katie\_Speaks](https://cl.desmos.com/u/Katie_Speaks)\
**Post date:** [March 2, 2023, 5:31pm UTC](https://cl.desmos.com/t/totals-and-count-if-from-aggregated-list/4757/3 "2023-03-02T17:31:36Z")

</div>

Thanks, that was perfect!
