1

How to use calculated column to calculate approved status workflow?

I tried this but it doesn't work.

IF([Approve status]="Pendding", 1, 0)
10
  • What are you trying to achieve here exactly using calculated column? Commented Aug 18, 2022 at 7:24
  • You cannot count multiple items based on status using calculated column. calculated column can only reference the column values from single item/row. easiest way is to use grouping, check my updated answer below for more information. Commented Aug 18, 2022 at 7:58
  • Ik I want to create 3 columns, each column will count a status , then will sum all the 1s
    – Bloom
    Commented Aug 18, 2022 at 8:07
  • In that case, you can create 3 columns for 3 different status values & use formulas like: =IF([Approval Status]="Pending",1,0) for Pending calculated column and =IF([Approval Status]="Approved",1,0) for Approved calculated column. Refer to the formula & column settings given in my answer. Commented Aug 18, 2022 at 8:21
  • =IF([Approval Status]="Pending",1,0) doesn't work
    – Bloom
    Commented Aug 18, 2022 at 9:49

3 Answers 3

0

Looks like you want the calculated column to return a Yes/No value; try this:

IF([Approve status]="Pendding", true, false)
0

If you are trying to create a calculated column based on approval status column, use formula like:

=IF([Approval Status]="Pending",1,0)

This will return 1 value in calculated column when Approval Status is equal to "Pending" else it will return 0 as value of calculated column.

Calculated column settings:

enter image description here


Follow steps given in my answer to create a calculated column in a list at: Formula does not work for SharePoint/Lists

Note:

  1. Sometimes comma(,) does not work in formula (I am not sure but it is based on language or regional settings on your site). In that case use semicolon(;) instead of comma(,) at all places in above formula.
  2. You cannot use "calculated value" option of existing columns as this option cannot reference other columns in list in formula. So, you have to create a column with "calculated" data type for referencing other columns in list in calculated formula.
  3. You have to use the correct "display" name of Approval Status column in your formula.

Update from comments:

If you want to get the count of number of approved, rejected and pending items, easiest way is to use the Grouping in list view on Approval Status column.

Follow Microsoft documentation for more information: Use grouping to modify a list or library view

0

According to this, the Approval Status field is a lookup field and not applicable for calculated fields. My approach to the issue would be to create a separate calendar view of items with a filter of Approval Status = Pending. This way, approvers can toggle between the approved and pending data and easily distinguish what needs to be approved.


If the answer is helpful, please click "√" on the left panel of the answer and kindly upvote it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.