Forum Discussion
LukeSykes
May 30, 2023Copper Contributor
Round up / down in calculated column
Hi I am trying to use a calculated column to round up or downs cash figures. I can achieve this easily in excel, I thought the formula would be similar just formatted to work with list column...
Rahul-kumar
May 30, 2023Brass Contributor
To achieve rounding up or down cash figures in a calculated column in SharePoint, you can utilize SharePoint's built-in functions to perform the necessary calculations and rounding. Here's an example of how you can create the calculated columns 'voucher rounding' and 'cash rounding' based on your requirements:
Open the list or library where you want to add the calculated columns.
Navigate to the settings for the list and click on "List Settings."
Under the "Columns" section, click on "Create column" to add a new calculated column.
Provide a name for the column, such as 'Voucher Rounding'.
In the "Type of information" section, select "Calculated (calculation based on other columns)".
In the "Formula" box, enter the following formula:
plaintext
Copy code
=IF(MOD(Total,5)<=2.5, ROUND(Total/3,0)*2, ROUND(Total/3,0)*2+5)
This formula calculates the 'voucher rounding' by dividing the 'Total' by 3, rounding it to the nearest whole number, and then multiplying it by 2. If the remainder of the 'Total' divided by 5 is less than or equal to 2.5, it rounds down. Otherwise, it rounds up to the nearest multiple of 5.
Select the appropriate data type and format for the column.
Click "OK" to create the 'Voucher Rounding' column.
Open the list or library where you want to add the calculated columns.
Navigate to the settings for the list and click on "List Settings."
Under the "Columns" section, click on "Create column" to add a new calculated column.
Provide a name for the column, such as 'Voucher Rounding'.
In the "Type of information" section, select "Calculated (calculation based on other columns)".
In the "Formula" box, enter the following formula:
plaintext
Copy code
=IF(MOD(Total,5)<=2.5, ROUND(Total/3,0)*2, ROUND(Total/3,0)*2+5)
This formula calculates the 'voucher rounding' by dividing the 'Total' by 3, rounding it to the nearest whole number, and then multiplying it by 2. If the remainder of the 'Total' divided by 5 is less than or equal to 2.5, it rounds down. Otherwise, it rounds up to the nearest multiple of 5.
Select the appropriate data type and format for the column.
Click "OK" to create the 'Voucher Rounding' column.