Formula that returns a string based on date period

I received a request that we be able to report on leads by created date and group them into budget periods. For example leads created between 8/16/22-8/16/23 should populate as “2023 Budget”

I created this formula below but have 1 lingering expression error.

IF(
DATEPART(“MONTH”,[properties.createdate]>=8) && DATEPART(“DAY”,[properties.createdate])>=16,
CONCAT(TEXT(YEAR([properties.createdate]+1)))," Budget",
CONCAT(TEXT(YEAR([properties.createdate])))," Budget",
)

This is my first foray into Hubspot formulas and the knowledge base is not in one place. Can anyone point me in the right direction on what this error could be or, even better, the solution.:smiling_face_with_sunglasses:

Hey, @hyoung22 :waving_hand: Did you get this resolved?

  • Can you share the specific error? Both adding the error message here as a reply + screenshots may be helpful to our community
  • For context, are you creating calculation property in-app or via the Properties API?

Best,

Jaycee

I think we are having a similar issue with different context. We are trying to create a field that will show the # of days the deal has been open. If it’s closed won or lost, it should reference the created date and close date. If it’s still open, it should reference a property we created for “Today’s Date” and created date. However, there is an “expression error” with our formula.

=if([properties.hs_is_closed]=TRUE,[properties.closedate]-[properties.createdate],[properties.today_s_date]-[properties.createdate])

(not shown in the screenshot, the number format is “Formated Number”)