Skip to content
All articlesSharePoint

SharePoint Calculated Column: Formulas, Examples and Limits

Create a SharePoint calculated column: where to add it, formula syntax, worked examples for IF, dates and text, and the limits Microsoft documents.

28 Oct 20268 min read
SharePoint Calculated Column: Formulas, Examples and Limits

What a SharePoint calculated column is

A calculated column shows the result of a formula built from other columns in the same list or library. The formula can add and subtract, compare values, join text, work out dates or test a condition with IF, and the result updates when the columns it uses change. Microsoft's example is a total price: =[quantity] * [item price].

Use one when the answer can be worked out from the same row: a due date 30 days after a start date, a full name from first and last name, a status label from two numbers.

How to create a calculated column

Microsoft documents this route, which works on a list or a document library:

  1. Open the list or library. Select the gear icon, then List settings (or Library settings).
  2. Under Columns, select Create column.
  3. Enter a Column name.
  4. Set the type to Calculated (calculation based on other columns).
  5. In the Formula box, type the expression. Use Insert Column to add a column reference.
  6. Choose the data type returned by the formula.
  7. Select OK.

The data type matters. A formula that returns a date needs a Date and Time return type, and one that returns text needs Single line of text. A mismatch shows as a #VALUE! error in the list.

Formula syntax

RuleWhat it means
Start with =Every formula begins with an equals sign
FunctionsWritten as the name, an opening parenthesis, the arguments separated by commas, and a closing parenthesis: =IF(...)
Column namesUse the display name. A name with spaces or special characters goes in square brackets, such as [Start Date]. Names are not case-sensitive
TextText constants go in double quotation marks, up to 255 characters
Joining textThe & operator joins values: =[First Name]&" "&[Last Name]
DatesDate constants use DATE(year,month,day)
OrderMultiplication runs before addition, so =5+2*3 returns 11 and =(5+2)*3 returns 21. Operators of equal precedence run left to right
NestingA formula can contain up to eight levels of nested functions

Calculated column examples

These come from Microsoft's own examples. Each result is the one Microsoft gives for the inputs shown.

Conditional formulas

FormulaInputsResult
=IF([Cost]>[Revenue],"Not OK","OK")Cost is above RevenueNot OK
=[Column1]>[Column2]15,000 and 9,000Yes
=IF(AND([Column1]>[Column2],[Column1]<[Column3]),"OK","Not OK")15, 9 and 8Not OK
=IF(OR([Column1]>[Column2],[Column1]<[Column3]),"OK","Not OK")15, 9 and 8OK
=NOT([Column1]+[Column2]=24)15 and 9No

A comparison on its own returns Yes or No. Wrap it in IF to return your own words.

Date and time formulas

FormulaInputsResult
=[Start Date]+30Any start dateA date 30 days later, such as an expiration date
=[Date Completed]-[Start Date]Two dates on a taskThe calendar days between them
=DATEDIF([Column1],[Column2],"d")1 January 1995 and 15 June 19991626 days
=DATEDIF([Column1],[Column2],"ym")The same dates5 months, ignoring full years
=DATE(YEAR([Column1]),MONTH([Column1])+[Column2],DAY([Column1]))6/9/2007 and 39/9/2007, three months later
=TEXT(WEEKDAY([Column1]),"dddd")19 February 2007Monday

Set the return type to Date and Time for the formulas that return a date.

Text formulas

FormulaInputsResult
=[Column1]&" "&[Column2]Carlos and CarvalloCarlos Carvallo
=UPPER([Column1])nina VietzenNINA VIETZEN
=PROPER([Column1])nina vietzenNina Vietzen
=LEFT([Column1],LEN([Column1])-2)Vitamin AVitamin
=TRIM([Column1])Text with spaces at each endThe same text without them
="Statement date: "&TEXT([Column2],"d-mmm-yyyy")5 June 2007Statement date: 5-Jun-2007

TEXT formats a value as it is displayed, so TEXT([Column2],"0%") on a column holding 40% returns 40%, not 0.4.

Test whether text contains a value

=ISNUMBER(FIND("BD",[Column1])) returns Yes if "BD" appears in Column1 and No if it does not. FIND returns an error value when the text is not found, which is why ISNUMBER wraps it.

What a calculated column cannot do

LimitDetail
Other rowsA formula uses values in the current row only
Other listsIt cannot reference another list or library, or a lookup field
The row IDIt cannot reference the ID of a newly inserted row
Column types you can referenceSingle line of text, number, currency, date and time, choice, yes/no and calculated
TODAY and MEMicrosoft lists them as not supported in calculated columns. They are supported when setting a column's default value
NOW and RANDNot supported in lists or libraries
NestingUp to eight levels of nested functions
ScopeA change to a formula applies only to that list or library

The TODAY restriction catches most people. A calculated column cannot count days overdue against today's date, because it recalculates when the row changes and has no clock of its own. For a value that must move every day, a scheduled Power Automate flow can write a fresh figure into an ordinary column; SharePoint and Power Automate covers building one.

Common errors

  • #VALUE! The formula returned a different type from the return type you chose, or an argument had the wrong type. Match the return type to the result, and use VALUE() to turn text into a number when you need to.
  • Column name not recognized. Use the column's display name, and put names with spaces or special characters in square brackets.
  • Wrong date result. Subtracting two dates gives a number of days, so set the return type to Number. Adding days to a date gives a date, so set it to Date and Time.
  • Formula rejected on save. Check commas between arguments, matching parentheses and quotation marks around text.

Frequently asked questions

What is a calculated column in SharePoint?

A column that shows the result of a formula using other columns in the same list or library, such as =[Start Date]+30 for an expiration date.

How do I add a calculated column in SharePoint?

Open the list, select the gear icon, then List settings. Under Columns, select Create column, name it, choose Calculated as the type, enter the formula and the return data type, and select OK.

Can a SharePoint calculated column use TODAY?

Microsoft lists TODAY as not supported in calculated columns. It can be used to set a column's default value. For a value that changes daily, use a flow that updates a normal column.

Can a calculated column reference another list?

No. A formula can use only columns in the same list or library, and only values from the current row.

Which functions can a calculated column use?

The ones Microsoft lists for SharePoint, which include IF, AND, OR, NOT, DATE, DATEDIF, TEXT, LEFT, RIGHT, UPPER, PROPER, TRIM, ROUND and SUM. NOW and RAND are not supported.

Can I use a calculated column in a document library?

Yes. Microsoft's steps apply to a list or a library, and the formula can use the library's other columns.

Why does my calculated column show #VALUE!?

The formula's result does not match the return type you chose, or a function received the wrong type of value. Change the return type or convert the value first.

How many functions can I nest?

Up to eight levels of nested functions in one formula.

About the author
Mark Smith - Co-Founder, SmiKar Software

Mark Smith co-founded SmiKar Software in 2015 and has spent the past decade helping organisations solve Microsoft 365 data management challenges. He works with the SmiKar team to build solutions for SharePoint archiving, storage optimisation, governance and compliance, supporting customers from growing businesses through to Fortune 500 enterprises.

More about SmiKar

Ready when you are

Cut your Microsoft 365 storage bill - keep your data in your tenant.