# Wrong count in list relation

**URL:** <https://community.glideapps.com/t/wrong-count-in-list-relation/1587>\
**Category:** Report a Bug\
**Created:** [November 1, 2019, 10:01am UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587 "2019-11-01T10:01:54Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 10:01am UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/1 "2019-11-01T10:01:54Z")

</div>

I have a list relation that shows the count as 4, but inside it shows just one item. I check the spreadsheet itself and actually it is just one item, but on Glide the item count shows as 4.

I’m not sure if this is a bug or if it’s something I’m doing wrong and it’s driving me a bit mad. I have a date based filter on the list relation. Screenshots attached. Would appreciate if anyone could point out what I am doing wrong.

 ![first%20view](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/0/01e1962fa1a077077963b7507bf4540d7698698c.png)

This is the list relation filter

 ![filter](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/a/a6056723f48ce57cb27e741c6440ef82b7a0e66b.png) ![list%20relation](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/3/3656eb561fa2a6a7da4db2b1ed877afe0523a1fd.png)

This is what shows inside

 ![4%20inside%20items](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/8/89ea0d19c6ab7234f933635ae552da6f6389e6db.png)

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 10:27am UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/2 "2019-11-01T10:27:01Z")

</div>

I think it’s a bug. The empty date field is also being counted for “after today”.

It’s a date time field, if that’s relevant.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 1, 2019, 11:39am UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/3 "2019-11-01T11:39:55Z")

</div>

Yes, I would say this is a bug.

Empty dates will not show in a calendar view, which is working correctly, but the filter should not be picking up the empty dates.

If you change the style to list instead, of calendar, do the other 3 records show with the filter still applied?

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 12:04pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/4 "2019-11-01T12:04:51Z")

</div>

Yes, it shows. It’s definitely related to how Glide is counting the date field and displaying in calendar format.

I have another list relation showing with a string-based filter applied. I’m checking for the string " + (HV" in the title. It shows a count of 21 in the list relation, but inside (displayed as calendar) there are only 17 items. When I change the format to something to non-calendar it shows 21 items.

 ![string%20check%20-%20list%20relation%20count](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/d/d1a2196fdafb2d8bb0d890f2f3b2d561b680d655.png)

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 12:25pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/5 "2019-11-01T12:25:24Z")

</div>

For this string based filter that I have mentioned here, Glide cannot really do anything. The records won’t show in the calendar format because the date is empty, because the users have neglected to input the date.

> [@Wrong count in list relation](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/4):
>
> Yes, it shows. It’s definitely related to how Glide is counting the date field and displaying in calendar format. I have another list relation showing with a string-based filter applied. I’m checking for the string " + (HV" in the title. It shows a count of 21 in the list relation, but inside (displayed as calendar) there are only 17 items. When I change the format to something to non-calendar it shows 21 items.

However, the count when filtered with the date itself is also picking up empty values. So that one definitely needs a fix.

Should I set the filter inside the spreadsheet itself using formulas and then set the Glide filter to just checking whether that spreadsheet column is TRUE?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 1, 2019, 12:30pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/6 "2019-11-01T12:30:02Z")

</div>

Yeah, the new column and true filter would have been my next suggestion for the time being. That’s what I would do.

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 1:28pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/7 "2019-11-01T13:28:08Z")

</div>

I’ve hit a snag. I have to check whether the status column is not empty AND the date column is empty, so I can alert the users to fill the date column. Apparently ARRAYFORMULA does not work with AND. It won’t propagate to the cells below. Any suggestions?

[https://support.google.com/docs/thread/5127906?hl=en](https://support.google.com/docs/thread/5127906?hl=en)

This is what I was trying to use: ARRAYFORMULA(AND(H2:H\<\>"", O2:O=""))

I tried to get around that by using COUNTA(L2:L, O2:O) in the arrayformula, but that doesn’t work either. Same problem as above. 😑

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 1:44pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/8 "2019-11-01T13:44:37Z")

</div>

I have a mildly lunatic solution  
ArrayFormula(IF(ISBLANK(L2:L) + ISBLANK(O2:O)\<\>2, ISBLANK(L2:L) + ISBLANK(O2:O), “”))

If one of the columns is empty, this will return 1  
If both are empty, this will return 2  
If both are filled, it returns 0

So it basically acts like a boolean. However I’m not sure if this is the way to go. Any better suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 1, 2019, 2:53pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/10 "2019-11-01T14:53:38Z")

</div>

Here, try this:

=ARRAYFORMULA(IFERROR(IFS(L2:L="", FALSE, O2:O\<\>"", TRUE), “Needs Date”))

IFS can check multiple conditions and will return the first value that equals true. If L2:L is empty (true statement), the I return FALSE as the value. You can make it blank if you want. If L2:L is not empty, then it checks O2:O to see if it’s filled. If it is, then I return TRUE. Again, you can make this blank if you want. If none of the conditions are met, then it returns ‘#NA’, which is an error, and is caught by IFERROR. This then returns the “Needs Date” value.

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 3:29pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/11 "2019-11-01T15:29:51Z")

</div>

> [@Jeff\_Hager](#):
>
> IFS(L2:L=“”, FALSE, O2:O\<\>“”, TRUE)

That’s a beautiful formula. This is what I did.  
=ArrayFormula(IF(L2:L=“”, “”, IFERROR(IFS(L2:L=“”, FALSE, O2:O=“”, TRUE))))

I have a column called Empty Date, so I put TRUE there if the date is empty.

I also see how my first solution was checking for an OR, which is not really what I want. This one exactly solves the problem.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 1, 2019, 3:43pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/12 "2019-11-01T15:43:47Z")

</div>

Just a couple observations with your formula…Your outside IF is checking L2:L="". Since you have that, the inner IFS will never become True for the L2:L check in there. If what you have is working, then I would strip it down to the following instead:

`=ArrayFormula(IF(L2:L="", “”, IF(O2:O="", TRUE, "")))`

Maybe I overcomplicated my solution since I had multiple conditions in my head. I think you are on the right path though.

---

<div class="post-metadata">

**Author:** ![Doomba](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/doomba/32/1133_2.png) [@Doomba](https://community.glideapps.com/u/Doomba)\
**Post date:** [November 1, 2019, 3:54pm UTC](https://community.glideapps.com/t/wrong-count-in-list-relation/1587/13 "2019-11-01T15:54:21Z")

</div>

Oh right. That’s true. Yes, this simplified formula works for my specific situation. I am looking for the second column which is left empty when the first column is necessarily filled in.

Thank you 😌
