I am creating an app based on a sharepoint list that has two date columns. One of these dates take in the date a reqest is submitted and the for the other I want it to be a date calculated based on the first column.
I am trying to write an if statement that says if the submit date is before Tuesday and after Thursday, the request is scheduled to be discussed for this Thursday, otherwise the request is scheduled for next Thursday.
I am not sure how to translate that into an if statement that returns a date.
Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous ,
Could you describe more clearly about "before Tuesday and after Thursday"?
Do you means that before this week Tuesday and after last week Thursday?
I'm a little confused about the rule that you described.
I assume the beginning of the week is Sunday.
According to my userstanding, if the request submitted date is last week's Firday and Satday and this week's Sunday and monday then the request is scheduled in this week.
To sum up, only the request submit on this week's Sunday and Monday, the request is scheduled in this week, otherwise next week.
Here's formula that I used:
If(Weekday(listname.requestsubmit)<=2,listname.requestsubmit-Weekday(listname.requestsubmit)+5,
listname.requestsubmit-Weekday(listname.requestsubmit)+12)
Best regards,
Community Support Team _ Phoebe Liu
The first idea I have, is to get the date selected week number and then either import a table that has the week numbber and Thursday date or use Switch.
So to get week number, I added a label titled "DateSelectedWeek" and entered this formula:
RoundUp((DatePicker1.SelectedDate - Date(Year(DatePicker1.SelectedDate), 1, 1) + (Weekday(Date(Year(DatePicker1.SelectedDate), 1, 1), Monday))) / 7, 0)
Then to determin if it would be scheduled this week or next week, I added a label titled "RequestScheduledWeek" and entered this formula:
If(Weekday(DatePicker1.SelectedDate) < 4, Value(DateSelectedWeek.Text), Value(DateSelectedWeek.Text) + 1)
Sunday is 1, so we want anything before Wednesday (4) to be scheduled this week and anything after to be next week.
Then in your Schedule Request Date field, you have the formula entered as:
Switch(Value(RequestWeek.Text), 26, Date(2019,6,27),27, Date(2019,7,4))
I only entered this week and next as an example, but you would do the whole year or instead of switch, import the table of data and use LookUp.
Hi @Anonymous ,
Could you describe more clearly about "before Tuesday and after Thursday"?
Do you means that before this week Tuesday and after last week Thursday?
I'm a little confused about the rule that you described.
I assume the beginning of the week is Sunday.
According to my userstanding, if the request submitted date is last week's Firday and Satday and this week's Sunday and monday then the request is scheduled in this week.
To sum up, only the request submit on this week's Sunday and Monday, the request is scheduled in this week, otherwise next week.
Here's formula that I used:
If(Weekday(listname.requestsubmit)<=2,listname.requestsubmit-Weekday(listname.requestsubmit)+5,
listname.requestsubmit-Weekday(listname.requestsubmit)+12)
Best regards,
Community Support Team _ Phoebe Liu
User | Count |
---|---|
157 | |
93 | |
80 | |
74 | |
57 |
User | Count |
---|---|
202 | |
166 | |
98 | |
94 | |
79 |