cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimoMigchielsen
Post Prodigy
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

Thank you in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions

@TimoMigchielsen 

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."

View solution in original post

8 REPLIES 8
mdevaney
Super User III
Super User III

@TimoMigchielsen 

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."

TimoMigchielsen
Post Prodigy
Post Prodigy

I've tried it like this:

Made 2 labels: https://gyazo.com/e86b4cc7b9497e1dbdb670b5a6dc96d2

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. 

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

@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."

What operator can I use to format it ? @mdevaney 

@TimoMigchielsen 

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."

View solution in original post

This returns 6 indeed @mdevaney 

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

@TimoMigchielsen 

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."  

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

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)