I need help with a fomula

Hi! im a real estate agent and im trying to create a formula to count de the days the property is in the market. I have 2 columns, “Starting day” and “closing date”.

The formula i have now, counts days from “starting date” to “today”, so it keeps counting after the closing day. this is the default formula = ROUNDUP(DAYS(TODAY(),{starting day}),0)

And i try this but doesn´t work: IF({closing date}=isblank,TODAY()-{starting date}, {closing date}-{starting date}).

Could you help me? Thanks!!

Hi Matias,

Try:

``````IF({Closing Date}="",DAYS(FORMAT_DATE(TODAY(),"YYYY-MM-DD"),{Starting Date}),DAYS({Closing Date},{Starting Date}))
``````

Curious to know how that same formula would look in the Advanced Formula Booster, the 3rd-party app that simplifies formula writing and breaks free of the Formula column?

Hi Gilles,

It’s working!

Could you tell me what this formula means? I read: If closing date is blank, then count the days (i don’t understand (FORMAT_DATE(TODAY(),“YYYY-MM-DD”)from today to starting date, if not, count the days from closing date to starting date. I`m right? Thanks for your valuable time!

You’re welcome Matias and you’re totally right in your interpretation.

FORMAT_DATE(TODAY(),“YYYY-MM-DD”) is a way to remove the time portion of today’s date (more exactly to give it a time of 00:00:00). If you don’t do that, the calculation will take TODAY() time portion into account, so instead of getting 4 days, you will get something like 4.XX days.

As a side note, I have the priviledge to be in charge of the Advanced Formula Booster project which aims at getting rid of all the unncessary complications that come with writing formulas in monday. We take all these small issues seriously because when they add up, formulas become unmanageable. To resolve this particular issue, we created 2 distinct functions to get today’s date: TODAY() which returns today’s date at 00:00:00 and NOW() which includes the current time.

If you’re satisfied with the answer, please mark the topic as solved!