# Outsmarting SharePoint using Calculated Columns Jonathan Weaver #SPSKC2015.

## Presentation on theme: "Outsmarting SharePoint using Calculated Columns Jonathan Weaver #SPSKC2015."— Presentation transcript:

Outsmarting SharePoint using Calculated Columns Jonathan Weaver #SPSKC2015

Jonathan Weaver jweaver@kctechgroup.com @j_weaver74, Consultant – KC Tech Group, LLC (www.kctechgroup.com)www.kctechgroup.com 15+ years in IT industry DEV, BA, QA, SharePoint Into logic puzzles SuDoKu, Rubik’s Cubes, Word Search If/Then queries Workflows

Agenda What is a Calculated Column? Limitations Overcoming Limitations Let’s go on a cruise! Basic Calculations If Statements Nested If Statements Today & Me Demo Questions Resources

What is a Calculated Column? Calculate based on other columns Display values based on logic statements Similar to functions in Excel or SQL

Limitations Maximum of 7 Nested Ifs Cannot use Lookup columns Entry box is very small

Overcoming Limitations Smarter Nesting / Concatenating Hidden columns Calculations Copy Lookups Workflows Notepad

Let’s go on a cruise!

Basic Calculations Creating a “Total” column Basic math =[Col1]+5 =[Col2]/[Col1] Compare =[Col1]>[Col2] And/Or/Not =AND([Column1]>[Column2], [Column1]<[Column3]) =OR([Column1]>[Column2], [Column1]<[Column3]) =NOT([Column1]+[Column2]=24)

If Statements Conditional Calculations =IF(Condition, Then, Else) =IF([Column1]<=[Column2], "OK", "Not OK") =IF([Column1]=15, "OK", "Not OK") =IF(AND([Column1]>[Column2], [Column1]<[Column3]), "OK", "Not OK") =IF(OR([Column1]>[Column2], [Column1]<[Column3]), "OK", "Not OK")

Nested If Statements Nest inside Then or Else sections =IF(Condition, IF(Condition, Then, Else), Else) =IF(Condition, Then, IF(Condition, Then, Else)) ALWAYS COUNT YOUR BRACKETS!!!!!! Demo

What if each color needs a different code?

Nested If Statements

Today & Me [Today] – Inserts Today’s date [Me] – Inserts the signed in user’s name

Today & Me [Today] – Inserts Today’s date [Me] – Inserts the signed in user’s name

DEMO If I haven’t rambled on past our time limit…

Questions?

Resources My favorite page for Calculation help http://msdn.microsoft.com/en- us/library/office/bb862071(v=office.14).aspx Massive Nested If http://blog.pathtosharepoint.com/2010/04/12/maximum-number- of-if-statements-in-a-calculated-column/