🗓 Month, Day, and Year Math Functions

You will need to calculate today’s date against the first date of the year to find the best pattern, in CalendarHours I found the formula for other formats that are easier and more reliable to use in glide.

Is it possible to take a date, for example 6/14/23, and return the name of the Day (Friday)?

The Format Date column would do it, but it’s generally not trusted. I would create a math column to pull out the weekday number, and then use an IF column to convert it into words.

WEEKDAY(Date)

@Darren_Murphy has a more robust method involving a separate table listing the days, and then use a single value column with the weekday number as an index value to get the word. Depends on how often you need to do the same thing.

3 Likes

Basically, I have a column called Visit Date and would like to find the day (Friday) they visited so over time I can identify trends (this user typically visits on Fridays).

So essentially I have to build an entire calendar database to be able to index and find the day? Cray. Maybe I can just use OpenAI to have it give me the day name if there is no easy calculation

If you use my method, it’s 2 columns in your existing data. A math column and an IF column.

If you use Darren’s method, you need two columns in your existing data. A math column and a single value column, along with a separate table with only 7 rows. One for each day of the week.

If you can trust the plugins, the format date column would work with one column. But it’s generally believed to be unreliable.

3 Likes

No, just one column in one table (any table), with 7 rows. One for each day of the week. I generally create a separate Lookup table for this, along with months of the year.

3 Likes

Hola!

My 2 cents to help with this:

let d = new Date(p1);
const week = ["Sunday","Monday","Tuesday","Wendesday","Thursday","Friday","Saturday"];

if (d.getDay()=="5")
   return week[d.getDay()]

Saludos a todos!

4 Likes

Thanks Ill try it!