cancel
Showing results for
Did you mean:
Post Prodigy

## Check if its friday bases on a date value

Hello there!

I need a formula that check if the date of a textvalue is equal to Friday. If its friday, it needs to return a "true" value.

It needs to look like this:

If( date of textvalue = friday, "It is friday", "It is not friday" )

How can I accomplish this? The date on the textvalue will always be formatted like this:      dd/mm/yyyy

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III

Let's assume Label3.Text is showing in the format dd/mm/yyyy.  To change it to the format mm/dd/yyyy instead you would use this code.  I assume the date is showing as a Text value.

``````Weekday(
Date(
Value(Right(Label3.Text,4)),
Value(Mid(Label3.Text,4,2)),
Value(Left(Label3.Text,2)
)
)``````

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

8 REPLIES 8
Super User III

You can use this function to check for a Friday.

``Weekday(DateValue(your_date_here), StartOfWeek.Monday))=5``

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Post Prodigy

I've tried it like this:

The first one only contains the date of today. Formatted like dd/mm/yyyy

Code for the second label which detecs the day:

``Weekday(DateValue(Label3.Text))``

This is how it returns it's values when using today function instead of my label:

``````Weekday(Today()) is going to return 1 since today is Sunday.

Sunday returns 1
Monday returns 2
Tuesday returns 3
Wednesday returns 4
Thursday returns 5
Friday returns 6
Saturday returns 7``````

The code I stated above returns the number "4". Which is equal to wednessday. it should've been 6 for friday.

I think I am almost there, just need to format my date value different.

Post Prodigy

Your code does not seem to be working for me. Check my message above, that might be why. @mdevaney

Super User III

@TimoMigchielsen
I think your date value would have to be formatted similar to what appears when you type

``Today()``

For me this is

``"mm/dd/yyyy"``

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Post Prodigy

What operator can I use to format it ? @mdevaney

Super User III

Let's assume Label3.Text is showing in the format dd/mm/yyyy.  To change it to the format mm/dd/yyyy instead you would use this code.  I assume the date is showing as a Text value.

``````Weekday(
Date(
Value(Right(Label3.Text,4)),
Value(Mid(Label3.Text,4,2)),
Value(Left(Label3.Text,2)
)
)``````

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Post Prodigy

This returns 6 indeed @mdevaney

Thank you! Can you explain to me what you did there?

Super User III

The date starts as a text value.  I extracted the numbers from each segment.  Then I placed them inside a Date() function which produces a date based on year, month, day 🙂

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Announcements

#### Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

#### Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

#### 2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,908)