Filtering between dates not working

Hello! I’m trying to build my budget and struggling with a formula that filters between dates.

Basically I need to return a sum of transaction rows when the three filter conditions are all met; the category is the same as the row, and the date is between Dec 1st and Dec 31st.

The formula works when I remove the two AND statements and the date filters, so I know the base of the formula is correct. Any suggestions on what I’m doing wrong?

Every data point in Coda has a specific type.

Meaning there are:

  • Numbers
  • Text
  • Dates
  • People
  • Row Values

And so on and so forth. Understanding data types is key to being able to filter correctly and use other coda formulas

Notice on your date chip (the green circular chip that says “Date”), it has a little calendar :calendar: icon on it. This signifies that the type of data within that chip is a date value.

On the other hand, anytime you enclose something between parentheses, this is a Text value

So what you were trying to do is equate, with an equal sign, a date value to a text value. And therein your issue.

What you could do in this case is use the Date() formula to construct a date value statically like this:

Date(2023, 12, 1) 

And set that equal to your Green date chip. That should work.

But, there’s likely an even easier solution thanks to Codas many date/time formulas.

That solution would merely be the use of the Month() formula.

Month() always returns a number, specifically the number of the month. So January is equal to one and February is equal to two and December is equal to 12.

So what you could do in the case is simple say:

Date.Month()=12

Or, if you are dealing with data across multiple years you could say:

Date.Month()=12 and Date.Year() = 2022

And boom! You are done

Heres some more thorough documentation and lessons on data-types in Coda with a fun interactive quiz at the end!

2 Likes

Thanks so much! I tested the two formulas below and they are both working beautifully. I appreciate your thorough response!

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