cancel
Showing results for
Did you mean:
Super User

## SPO Calculated column to work out SLA based on days and hours

Hello,

I need to setup a Due Date calculated column on an SPO list and whilst I've managed to work out the formula for days, I cant quite work out hours?!

I have SLA priorities on my list as per the below:

5= 365 days

4= 5 days

3= 5 days

2= 1 day

1= 8 hours

=IF(Priority="5",Created+365,IF(Priority="4",Created+5,IF(Priority="3",Created+5,IF(Priority="2",Created+1,IF(Priority="1",Created+0.8)))))

If I helped you solve your problem - please mark my post as a solution and consider giving me a like if you liked my response!

7 REPLIES 7
Anonymous
Not applicable

Hi,

``=IF(Priority="5", addDays(Created, 365), IF(Priority="4", addDays(Created, 5), IF(Priority="3", addDays(Created, 5), IF(Priority="2", addDays(Created,1),IF(Priority="1", addHours(Created,8))))))``

Hope this helps,

Alex

Super User

Hi @Anonymous ,

I am getting this error:

The formula contains a syntax error or is not supported.

If I helped you solve your problem - please mark my post as a solution and consider giving me a like if you liked my response!

Anonymous
Not applicable

Hi,

Sorry wrong formula:

``=IF(Priority="5", DateAdd(Created, 365, Days), IF(Priority="4", DateAdd(Created, 5, Days), IF(Priority="3", DateAdd(Created, 5, Days), IF(Priority="2", DateAdd(Created,1, Days),IF(Priority="1", DateAdd(Created,8, Hours))))))``

Hope this helps,

Alex

Super User

Hi @Anonymous - still getting invalid syntax

If I helped you solve your problem - please mark my post as a solution and consider giving me a like if you liked my response!

Anonymous
Not applicable

Hi,

Would you be able to share a screenshot of the flow?

Thanks,

Alex

Super User

Ah, maybe this is where I'm going wrong?

I wanted to do this directly within a calculated column in SharePoint? This is where it is failing.

If I helped you solve your problem - please mark my post as a solution and consider giving me a like if you liked my response!

Anonymous
Not applicable

Hi,

Ah. if it is only the hour calculation which is causing the issue, then try:

Created + 8/24

Hope this helps,

Alex

Announcements

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!