Forum Discussion
Bd2023-b
Aug 29, 2023Brass Contributor
Sharepoint list issue - Enter valid condition
Hi , I have 2 list column - Mark% and Grade . If Mark % > =60 % - Grade A , Mark % > 31% - 59% - Grade B , Mark % - 0 % to 30% - Grade C. I tried but getting error - Enter a valid condition I put the condition for Grade list column . Any way to fix it ?
Bd2023-bYou cannot refer another column in "default value" formula for any column in column settings.
So, you will have to create calculated column for "Grade".
Assuming Mark % column is of type "Number", you can use formula for Grade column like below:
=IF([Mark %]>=60,"Grade A",IF([Mark %]>30,"Grade B","Grade C"))
OR
=IF([Mark %]>=60,"Grade A",IF([Mark %]>30,"Grade B",IF([Mark %]>=0,"Grade C","")))
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Bd2023-bYou cannot refer another column in "default value" formula for any column in column settings.
So, you will have to create calculated column for "Grade".
Assuming Mark % column is of type "Number", you can use formula for Grade column like below:
=IF([Mark %]>=60,"Grade A",IF([Mark %]>30,"Grade B","Grade C"))
OR
=IF([Mark %]>=60,"Grade A",IF([Mark %]>30,"Grade B",IF([Mark %]>=0,"Grade C","")))
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- Lalit MohanIron Contributor
Hi Bd2023-b
The error message "Enter a valid condition" means that the conditional formula you entered is not valid. In your case, the formula is:
=IF(Mark% >= 60, "Grade A", IF(Mark% > 31, "Grade B", "Grade C"))
This formula is correct, but it is not working because you are trying to apply it to the Grade column. The Grade column is a Choice column, and you can't apply conditional formulas to Choice columns.
To fix this, you need to apply the conditional formula to the Mark% column. The following formula will do what you want:
=IF(Mark% >= 60, "A", IF(Mark% > 31, "B", "C"))
This formula will set the value of the Grade column to "A" if the value of the Mark% column is greater than or equal to 60. It will set the value of the Grade column to "B" if the value of the Mark% column is greater than 31 but less than or equal to 59. And it will set the value of the Grade column to "C" if the value of the Mark% column is 0 or less than 30.
To apply this formula, follow these steps:
- Go to the list settings for the list that contains the Mark% and Grade columns.
- Click on the "Conditional formatting" tab.
- Click on the "Add rule" button.
- In the "Rule type" dropdown, select "Formula".
- In the "Formula" box, enter the following formula:
=IF(Mark% >= 60, "A", IF(Mark% > 31, "B", "C"))
- Click on the "OK" button.
The conditional formatting rule will now be applied to the Mark% column.