# Inputted Goggle Formula not working?

**URL:** <https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639>\
**Category:** Ask for Help\
**Created:** [April 17, 2023, 6:31pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639 "2023-04-17T18:31:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 17, 2023, 6:31pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/1 "2023-04-17T18:31:11Z")

</div>

Hi Gurus,

Im trying to input the following ‘dynamic’ google sheets formula via the app interface I have created;

=COUNTIFS(Orders!A:A, INDIRECT(ADDRESS(ROW(), COLUMN()+11)), Orders!D:D, “\>=”&DATE(YEAR(EDATE(TODAY(),-1)), MONTH(EDATE(TODAY(),-1)), 1), Orders!D:D, “\<=”&DATE(YEAR(EDATE(TODAY(),-1)), MONTH(EDATE(TODAY(),-1)), EOMONTH(EDATE(TODAY(),-1),0)))

However its not presenting as a formula in the google sheet its linked to. It for some reason returns the result 0 in google sheets.

The column is set as the type “number” inside glide?

What am i doing wrong?

Why would the formula not be working?

Many thanks in advance for any light you can shed on this issue 🙏

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [April 17, 2023, 6:35pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/2 "2023-04-17T18:35:11Z")

</div>

What kind of interface?

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 17, 2023, 6:49pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/3 "2023-04-17T18:49:45Z")

</div>

Hey Uzo  
Its a ‘text entry’ field

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [April 17, 2023, 6:52pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/4 "2023-04-17T18:52:51Z")

</div>

You cant add a formula using the text entry field. It will be considered as text… You can use Google Scripts to read and set that text formula as an actual formula. Can you explain why you are trying to do that? You can use arrayformula to set formula for all rows in google sheets

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 17, 2023, 6:54pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/5 "2023-04-17T18:54:47Z")

</div>

Got you … Thanks  
Do you have a link to were i could learn about google scripts by any chance?  
I’ve never used it?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [April 17, 2023, 6:55pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/6 "2023-04-17T18:55:47Z")

</div>

No, I don’t have a link… just google it. I can write that code for you, is very simple.

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 17, 2023, 6:58pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/7 "2023-04-17T18:58:15Z")

</div>

No problem.  
Problem I think I have though is that in google sheets its only displaying the number 0 after its been synced from glide after i input the formula mentioned above?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [April 17, 2023, 7:00pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/8 "2023-04-17T19:00:53Z")

</div>

Because there is a text value, and your glide column is set to the number, what is shown in google sheets?

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 17, 2023, 7:10pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/9 "2023-04-17T19:10:16Z")

</div>

ok thanks

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 18, 2023, 1:22am UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/10 "2023-04-18T01:22:08Z")

</div>

Can you describe more on what the formula is doing here, and do you absolutely need it in Sheets or working with Glide calculated columns would be better?

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 18, 2023, 12:46pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/11 "2023-04-18T12:46:09Z")

</div>

Hey! The formula is designed to search another sheet within the spreadsheet for relevant data and then return a numbered tally(result) to the cell. Can you explain more how I could do this with Glide calculations? Thanks in advance 🙏

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 18, 2023, 1:04pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/12 "2023-04-18T13:04:24Z")

</div>

You probably want a relation to match to the relevant records in your second table, and then a rollup through that relation to calculate a sum/total of matching records.

How do you define “relevant” in this case? (Looks to be something to do with Dates?)

If you can show screen shots of each of the two tables, we can probably give some more specific guidance.

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 18, 2023, 3:16pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/13 "2023-04-18T15:16:20Z")

</div>

Hey Darren! Thanks for the input 🙏 Your solution definitely sounds like a great idea if it is possible. My formula searches for matching text in one column and then counts up all dates from the a specific month that the text has a record and then returns a total …. If that makes sense? I’ll do some googling on how to use the relationships feature in Glide. If you have any tips that would suit my case it would much appreciated. Thanks again 🙏

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 18, 2023, 3:30pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/14 "2023-04-18T15:30:24Z")

</div>

> [@Rob\_Field](#):
>
> My formula searches for matching text in one column and then counts up all dates from the a specific month that the text has a record and then returns a total …. If that makes sense?

It kind of makes sense, but it would be much easier to visualise if you could show me a screen shot of what the data looks like, and point out the specific columns that need to be considered.

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 18, 2023, 3:48pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/15 "2023-04-18T15:48:10Z")

</div>

![IMG_1321](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/1/512c8d22a16fa8e5079a964f6cd6502d552691a7.jpeg)

I hope this helps. Really appreciate the help

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 18, 2023, 4:04pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/16 "2023-04-18T16:04:08Z")

</div>

Yes, that helps a lot.

Can I assume that somewhere in your App you will be expecting the user to enter a Coupon code and select a Month?

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 18, 2023, 4:17pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/17 "2023-04-18T16:17:11Z")

</div>

No the sheet your looking at is an automatic and live feed from our e-commerce store. The idea is our glide app will give us a total of the amount of times each specific coupon was used on a specific month …. If that makes sense?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 18, 2023, 4:26pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/18 "2023-04-18T16:26:39Z")

</div>

ah, I see!

Okay, that’s easy. Do the following in the Glide Data Editor, in your Orders table:

- Create a Math column, using the following formula: `Year(Date) * 100 + Month(Date)`
- In the formula, use your Date Paid column as a replacement for `Date`. Set the precision to 1, and uncheck the “Use group separator” box.
- This should give you a number the represents the month and year for each record in the format YYYYMM
- Now create a template column that combines the Coupon column and the Math column
- Now create a multiple relation column that matches the template column with itself.
- Now create a rollup column that does a count of the Coupon column via the relation column.
- The result of this last column will be the number you are after.

---

<div class="post-metadata">

**Author:** ![Rob\_Field](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rob_field/32/84139_2.png) [@Rob\_Field](https://community.glideapps.com/u/Rob_Field)\
**Post date:** [April 18, 2023, 5:53pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/19 "2023-04-18T17:53:25Z")

</div>

Wow this is some wizardry thanks! 🙏 Only one glitch I have is that for one of the months it is adding up all the times the coupon appears and not just for that month? Which is hard to understand because math column creates a unique number for each month? So I’m not sure what’s happening. Anyways I’ll keep tinkering and see if I can get to the bottom of it. Thanks again legend! 🙏🙏🙏

---

<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:** [April 18, 2023, 9:54pm UTC](https://community.glideapps.com/t/inputted-goggle-formula-not-working/60639/20 "2023-04-18T21:54:59Z")

</div>

If you can show how you set up the math, template, relation, and rollup columns, we can see if something was missed.
