Introducing TypeScript – Microsoft’s new open source JS language

TypeScript is a language for application-scale JavaScript development.TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Any browser. Any host. Any OS. Open Source.

Starts from JavaScript, Ends with JavaScript

TypeScript starts from the syntax and semantics that millions of JavaScript developers know today. With TypeScript, you can use existing JavaScript code, incorporate popular JavaScript libraries, and be called from other JavaScript code. TypeScript compiles to clean, simple JavaScript code which runs on any browser, in Node.js, or in any other ES3-compatible environment.


Read the specification in doc or pdf

Discuss and provide feedback on the language.

Play with the bits and file bugs.

Join the #typescript Twitter discussion and follow the CodePlex project.


Tutorial – Best way to get up to speed on TypeScript.

Forums – Great place to get help with using TypeScript.

SharePoint Calculated Column Formulas & Functions – The Essential Guide

  • SharePoint uses pretty much the same engine as Excel for it’s calculated columns and field validation stuff. There are some exceptions, such as NETWORKDAYS and some other functions not being included. Try prototyping your formulas in Excel first and then applying them to SharePoint.

    The goal of this page is to become the definitive list of formulas and operations used in SharePoint Calculated Columns. I try to answer all formula requests but i’d rather see you learn the fundamentals than get a quick fix, so please read all references carefully before submitting a scenario via the comments.

    In terms of “programming is hard” – there’s not a whole lot to this stuff as it is very well defined and encapsulated. Once you master it, you will be the new Office rockstar- careers have been built on this.

    Did I miss one? Please drop a note in the comments and i’ll get it added!

    Type Explanation Output
    NUMBERS  0
    Profit Shows the percentage profit on a sale (tick “Show as percentage”) 10%
    Markup Gives a price from a cost and a percentage markup $120.00
    Commission Gives the commission due on a sale (based on a commission %) $25.00
    Formatting Formatted with $ curency, comma thousand seperator and 2 decimal places $1234.56
    Negative numbers in brackets (95.99)
    & Concatanate (put two text values or fields together)
    4 & “3”
    ^ Power (e.g. [Field]^2 = Squared)
    /, +, -, * Divide, Add, Subtract, Multiply
    = (Equal to) > (Greater than) >= (Greater than or equal to)
    <> Not equal to) < (Less than) <= (Less than or equal to)
    Time only TEXT([DateTimeField],”hh:mm:ss”) 01:21:51
    Weekday TEXT([DateField],”dddd”) Wednesday
    TEXT([DateField],”ddd”) Wed
    Month TEXT([DateField],”mmmm”) October
    TEXT([DateField],”mmm”) Oct
    Year TEXT([DateField],”yyyy”) 2012
    TEXT([DateField],”yy”) 12
    Combinations TEXT([DateField],”mmmm dd, yyyy” October 17, 2012
    Fiscal Year Shows which fiscal year a date falls in (1st October)
    FY & IF(DATE(YEAR([Date]), 10, 1)>[Date], YEAR([Date]), YEAR([Date])+1) FY 2012
    Season Shows which season a date falls in. Takes into account one month offset from quarter.
    Quarter Shows which quarter a date falls in
    Q & INT((MONTH([Date])-1)/3)+1 Q1
    Q & INT((MONTH([Date])-1)/3)+1 & “-” & YEAR([Date]) Q1-2012
    Week Number Shows the week number (US style)
    Week Commencing Shows the date of the first day of the week (useful for grouping by week)
    [Date]-WEEKDAY([Date])+1 3/4/2012
    Day/Night Shows whether time is day or night
    IF(AND(HOUR([Time])>6,HOUR([Time])<18),”Day”,”Night”) Day
    AM/PM Shows whether a time is AM or PM
    IF(HOUR([Time]) < 12,”AM”,”PM”) PM
    Modified Shows whether an item has been modified since creation
    IF([Modified] > [Created], “Changed”, “Original”) Changed
    Marks out of ten Gives general comments on a mark out of ten
    CHOOSE(INT([Marks]/3),”Bad”,”Poor”,”Good”,”Great”) Great
    Random String Chooses a string at random, based on the time (in seconds)
    CHOOSE(MOD(TEXT(Created,”s”),2)+1,”String A”,”String B”, “String C”) String C
    TEXT (Value, Format) Converts Value to a Text value, using Format 2012|04
    TEXT([Created], “yyyy|mm”)
    REPT (Text, Number) Repeats Text the given Number of times HelloHelloHello
    FIXED (Num, Dec, NoCommas) Returns Number with the given number of decimals as text (commas optional)
    FIXED(2044.23,1,TRUE) 2044.23
    FIXED(2044.23,0,FALSE) 2,044
    LEN (Text) The length of Text 4
    LEFT (Text, Number) Return X characters from the left
    LEFT(“The Quick Brown Fox”, 5) The Q
    RIGHT (Text, Number) Return X characters from the right
    RIGHT(“The Quick Brown Fox”, 5) n Fox
    MID (Text, Num1, Num2) Returns Number2 characters from the middle of Text, starting at Number1
    MID(“The Quick Brown Fox”, 4, 15) Quick Brown
    SEARCH (Text1, Text2, Num) Returns the index of Text1 within Text2,starting the search at index Number
    SEARCH(“Banana”, “Banana Banana”, 4) 8
    LOWER (Text) Text in lower case
    LOWER(“Hello”) hello
    UPPER (Text) Text in upper case
    UPPER(“Hello”) HELLO
    PROPER (Text) Capitalize first letter of each word
    PROPER(“good morning”) Good Morning
    TRIM (Text) Removes spaces from the start and end
    TRIM(” Hello “) Hello
    CLEAN (Text) Returns Text without non-printable characters added by clipboard or similar
    CLEAN(“String1? String2??”) String1 String2
    REPLACE (T1, N1, N2, T2) Replaces Number2 characters starting at Number1 from Text1 with Text2
    REPLACE(“Hello”,2,4,”i”) Hi
    CONCATENATE (T1, T2, …) Combines the string values together into one string
    CONCATENATE(“A”,” Fine “,”Morning”) A Fine Morning
    DOLLAR (Number, Decimals) Converts number to currency text, with the given number of decimals
    DOLLAR(11.267,2) $11.27
    EXACT (Text1, Text2) Checks if two text values are identical, returns boolean
    EXACT(“Hello”,”hello”) False
    SUM (Number1, Number2, …) Returns the total of all Numbers and number-like values
    SUM(0, 2, “26”, 100, TRUE) 128
    MINA (Number1, Number2, …) Gets the smallest of the numbers, including non-number values
    MINA(0, 2, “26”, 100, “MyString”, TRUE) 0
    MIN (Number1, Number2, …) Gets the smallest of the numbers, including Text fields containing numbers
    MIN(0, 1, “26”, 100) 0
    MAXA (Number1, Number2, …) Gets the largest of the numbers, including on-number values
    MAXA(0, 2, “26”, 100, “MyString”, TRUE) 100
    COUNTA (Value1, Value2, …) Counts all values, including empty text (“”), ignoring empty columns
    COUNTA(5, 0,TRUE) 3
    COUNT (Num1, Num2, …) Averages the Numbers, ignoring non-Number values
    COUNT(5, 0,TRUE) 2
    AVERAGEA (Num1, Num2, …) Averages the Numbers, non-Number values are interpreted
    AVERAGEA(5,0, TRUE) 2
    AVERAGE (Num1, Num2, …) Averages the Numbers, ignoring non-Number values
    AVERAGE(10, 0, “”, “0”) 5
    VALUE (Text) Converts Text to a Number, Date or Time, according to its format
    VALUE(“00:05”) 00:05
    TRUNC (Number) Returns Number with decimals removed
    TRUNC(14.999999) 14
    SQRT (Number) Returns the square root
    SQRT(25) 5
    SIGN (Number) Returns -1 for negative numbers, 1 for positive, and 0 when 0
    SIGN(-5.2786) -1
    ROUNDUP (Num1, Num2) Rounds Number1 to Number2 decimals, always rounding up
    ROUNDUP(22.0001, 0) 23
    ROUNDDOWN (Num1, Num2) Rounds Number1 to Number2 decimals, always rounding down
    ROUNDDOWN(122.492, 1) 122.4
    ROUND (Number1, Number2) Rounds Number1 to Number2 decimals
    ROUND(221.298, 1) 221.6
    PI () Returns Pi to 15 decimal places
    PI() 3.14159265358979
    ODD (Number) Rounds Number up to the nearest odd number
    ODD(1.5) 3
    MOD (Number1, Number2) Returns the remainder of Number1 divided by Number2
    MOD(5, 4) 1
    EVEN (Number) Rounds Number up to the nearest even number
    EVEN(0.5) 2
    ABS (Number) Makes a number positive if it is negative
    ABS(-1) 1
    AND (Condition1, Condition2) Returns True if both conditions are True
    AND(4>=3,3>2) True
    OR (Condition1, Condition2) Returns True if either condition is True
    OR(4>=3, 3<2) True
    NOT (Condition1) Returns the opposite to the condition
    NOT(1=1) False
    CHOOSE(Num, Val1, Val2, …) Returns the value corresponding to the number. Up to 29 values can be used.
    CHOOSE(2, “A”, “B”, “C”, “D”) B
    IF(Condition, Val1, Val2) If Conditon is true, return Value1, otherwise return Value2
    IF([Modified] > [Created], “Changed”, Original) Changed
    ISTEXT (Value) Returns True if Value is Text
    ISTEXT(99) False
    ISNUMBER (Value) Returns True if Value is a Number, oherwise False
    ISNUMBER(99) { True
    ISNONTEXT (Value) Returns True if Value is not text or is empty, False otherwise
    ISNONTEXT(99) True
    ISNA (Value) Returns True if Value returns error #N/A, otherwise False
    ISERR(#N/A) True
    ISLOGICAL (Value) Returns True if Value returns a logical value (True or False), False otherwise
    ISERR (Value) Returns True if Value returns an error (except #N/A), otherwise False
    ISERR(#REF!) True
    ISBLANK (Value) Returns True if Value is empty, otherwise False
    IF(ISBLANK([Attendee]) Needs Attendee
    Lookup columns Not supported
    [ID] Only works on column addition/update, will not work from then on
    [Today] and [Me] Only available in default columns

    AND function

    Returns the logical value TRUE if all of the arguments are TRUE; returns FALSE if one or more arguments is FALSE.



    Logical1, logical2, … are 1 to 30 conditions you want to test that can be either TRUE or FALSE.


    • The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be column references that contain logical values.
    • If a column reference argument contains text, AND returns the #VALUE! error value; if it is empty, it returns FALSE.
    • If the arguments contain no logical values, AND returns the #VALUE! error value.

    Example 1

    Formula Description (Result)
    =AND(TRUE, TRUE) All arguments are TRUE (Yes)
    =AND(TRUE, FALSE) One argument is FALSE (No)
    =AND(2+2=4, 2+3=5) All arguments evaluate to TRUE (Yes)

    Example 2

    Col1 Col2 Formula Description (Result)
    50 104 =AND(1<[Col1], [Col1]<100) Because 50 is between 1 and 100 (Yes)
    50 104 =IF(AND(1<[Col2], [Col2]<100), [Col2], “The value is out of range.”) Displays the second number, if it is between 1 and 100, otherwise displays a message (The value is out of range.)
    50 104 =IF(AND(1<[Col1], [Col1]<100), [Col1], “The value is out of range.”) Displays the first number, if it is between 1 and 100, otherwise displays a message (50)

    OR function


    Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.


    OR(logical1, [logical2], ...)

    The OR function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

    • Logical1, logical2, … Logical1 is required, subsequent logical values are optional. 1 to 255 conditions you want to test that can be either TRUE or FALSE.


  • Common Date & Time Formulas

    Get Week of the year =DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time]))+0.5-WEEKDAY(DATE(YEAR([Start Time]),MONTH([Start Time]),DAY([Start Time])),2)+1

    First day of the week for a given date: =[Start Date]-WEEKDAY([Start Date])+1

    Last day of the week for a given date: =[End Date]+7-WEEKDAY([End Date])

    First day of the month for a given date: =DATEVALUE(“1/”&MONTH([Start Date])&”/”&YEAR([Start Date]))

    Last day of the month for a given year (does not handle Feb 29). Result is in date format: =DATEVALUE (CHOOSE(MONTH([End Date]),31,28,31,30,31,30,31,31,30,31,30,31) &”/” & MONTH([End Date])&”/”&YEAR([End Date])) Day Name of the week : e.g Monday, Mon =TEXT(WEEKDAY([Start Date]), “dddd”) =TEXT(WEEKDAY([Start Date]), “ddd”)

    The name of the month for a given date – numbered for sorting – e.g. 01. January: =CHOOSE(MONTH([Date Created]),”01. January”, “02. February”, “03. March”, “04. April”, “05. May” , “06. June” , “07. July” , “08. August” , “09. September” , “10. October” , “11. November” , “12. December”)

    Get Hours difference between two Date-Time : =IF(NOT(ISBLANK([End Time])),([End Time]-[Start Time])*24,0)

    Date Difference in days – Hours – Min format : e.g 4days 5hours 10min : =YEAR(Today)-YEAR(Created)-IF(OR(MONTH(Today)<MONTH(Created),AND(MONTH(Today)=MONTH(Created), DAY(Today)<DAY(Created))),1,0)&” years, “&MONTH(Today)-MONTH(Created)+IF(AND(MONTH(Today) < =MONTH(Created),DAY(Today)<DAY(Created)),11,IF(AND(MONTH(Today)<MONTH(Created),DAY(Today) > =DAY(Created)),12,IF(AND(MONTH(Today)>MONTH(Created),DAY(Today)<DAY(Created)),-1)))&” months, “&Today-DATE(YEAR(Today),MONTH(Today)-IF(DAY(Today)<DAY(Created),1,0),DAY(Created))&” days”

    Display SharePoint List Items Age: Create a SharePoint Calculated Column to Display a List Item as “X” Days Old
    DAY(Today)<DAY(Created))),1,0)&” years, “&MONTH(Today)-MONTH(Created)+IF(AND(MONTH(Today)
    >=DAY(Created)),12,IF(AND(MONTH(Today)>MONTH(Created),DAY(Today)<DAY(Created)),-1)))&” months,
    “&Today-DATE(YEAR(Today),MONTH(Today)-IF(DAY(Today)<DAY(Created),1,0),DAY(Created))&” days”

    Workdays Logic

    Here’s a basic approach for Calculated Columns workdays logic: Working Days, Weekdays and Holidays in SharePoint Calculated Columns:

    This shows how to combine an approach like that into Workflow logic: Limiting SharePoint Workflow Due Dates to Business Days:”></a

    Calculate work days excluding holidays in InfoPath 2010 using SharePoint 2010 and Excel Services:

    A blanket warning about anything to do with time & date programming and specific ranges like work days – always keep in mind that there’s: – Your Application logic’s concept of work week – SharePoint’s regional time and date, locale & work week settings – The Users desktop/profile settings such as region, timezone, personal variations such as different work days

  • DON’T FORGET – if you really can’t seem to come up with a formula that suits your needs based on what’s available in Excel/SharePoint formulas and functions, chances are you can achieve what you need with either:

    Option A – (SharePoint 2013 only) Use JSLink to do your calculations in JavaScript on the client side. Here’s an article on the basics of implementing JSLink in SharePoint 2013. After that, you have the whole JavaScript language at your disposal to do calculations on the fly. There are plenty of JS/Jquery libraries such as this one that can handle the heavy lifting for you.

    Option B – (SharePoint 2010/2007 only) Whip up some custom XSLT as described here and make your own custom columns that play by the rules you define there.

  • If you are still stumped after reading the information on this page, feel free to drop your question in the comments section at the bottom of the page and i’ll do my best, time-permitting, to help you out. This stuff takes stubbornness more than brains so chances are, if you stick it out, you can solve the scenario on your own and learn for next time. Please give it a go on your own first before posing a question here!

    The hardest part of Calculated columns for most people is figuring out how to combine multiple functions and values together into one formula- the following article is great for explaining that part:

    Make sure your formula is not capping out on one of the following limits:
    Formula length: 1024 characters
    Calculation length: 2048 characters
    Filter length: 256 characters

    You can avoid broken formulas by adhering to this basic Excel guidance (only SharePoint-related sections listed below):

Large collection of Free Microsoft eBooks for you, including: SharePoint, Visual Studio, Windows Phone, Windows 8, Office 365, Office 2010, SQL Server 2012, Azure, and more.

Eric Ligman has assembled a nice little collection of free Microsoft ebook downloads:

Moving to Microsoft Visual Studio 2010

Programming Windows 8 Apps

Programming Windows Phone 7

643352_win Phone.indd

Programming Windows Phone 7 (Special Excerpt 2)

Office 365 – Connect and Collaborate virtually anywhere, anytime

Microsoft Office 2010 First Look

Security and Privacy for Microsoft Office 2010 Users


Getting started with
Microsoft Office 2010 – For IT Professionals


Planning guide for Microsoft Office 2010 – For IT professionals


Deployment guide for Microsoft Office 2010 – For IT professionals


Operations guide for Microsoft Office 2010 – For IT professionals


Technical reference for Microsoft Office 2010 – For IT professionals


Understanding Microsoft Virtualization R2 Solutions


Introducing Windows Server 2012


Introducing Microsoft SQL Server 2012


Introducing Microsoft SQL Server 2008 R2

Configure Kerberos Authentication for SharePoint 2010 Products

Business continuity management for SharePoint Server 2010

Deployment guide for SharePoint Server 2010

Get started with SharePoint Server 2010

Governance guide for Microsoft SharePoint Server 2010

Profile synchronization guide for SharePoint Server 2010

Remote BLOB storage for Microsoft SharePoint Server 2010

Technical reference for Microsoft SharePoint Server 2010

Upgrading to SharePoint Server 2010


Getting Started with SharePoint Server 2010


Planning guide for sites and solutions for Microsoft SharePoint Server 2010, Part 1


Planning guide for sites and solutions for Microsoft SharePoint Server 2010, Part 2


Planning guide for server farms and environments for Microsoft SharePoint Server 2010


Capacity planning for Microsoft SharePoint Server 2010

SQL Server 2012 Tutorials: Analysis Services – Tabular Modeling

Microsoft SQL Server AlwaysOn Solutions Guide for High Availability and Disaster Recovery

Transact-SQL Data Manipulation Language (DML) Reference

QuickStart: Learn DAX Basics in 30 Minutes

SQL Server 2012 Tutorials: Analysis Services – Data Mining

Microsoft SQL Server Analysis Services Multidimensional Performance and Operations Guide

Data Analysis Expressions (DAX) Reference

SQL Server 2012 Upgrade Technical Guide

Backup and Restore of SQL Server Databases

SQL Server 2012 Tutorials: Analysis Services – Multidimensional Modeling

Master Data Services Capacity Guidelines

In The Classroom - Digital Storytelling

Digital Storytelling

In The Classroom - Free Tools

Free Tools in the Classroom

In The Classroom - Movie Maker

Windows Live Movie Maker in the Classroom

In The Classroom - Windows 7

Windows 7 in the Classroom

In The Classroom - Web Apps

Microsoft Office Web Apps Teaching Guide

In The Classroom - Office

Microsoft Office in the Classroom

Critical Thinking - In The Classroom

Developing Critical Thinking through Web Research Skills

In The Classroom - Bing

Bing in the Classroom

Moving Applications to the Cloud, 2nd Edition

Windows Azure Prescriptive Guidance

Windows Azure Service Bus Reference

Intro to ASP.NET MVC 4 with Visual Studio (Beta)

Deploying an ASP.NET Web Application to a Hosting Provider using Visual Studio

Getting Started with ASP.NET 4.5 Web Forms (Beta)

Introducing ASP.NET Web Pages 2


Own Your Future

W7PUG Cover-free

Windows 7 Power Users Guide


Deploying Windows 7 Essential Guidance


Welcome to Windows 7

What You Can Do Before You Call Tech Support (Windows 7)

Introducing “Napa” Office 365 Development Tools

From Jason Zander’s Blog Post:

Yesterday was a very exciting day for Office and SharePoint! The team unveiled plans for the new Office at a press conference, and released a public preview of Office and SharePoint 2013. You can find the press release available on the Microsoft News Center, and watch the video webcast by CEO Steve Ballmer on-demand . You can also download the release at

But the excitement doesn’t stop there – if you’re a developer you’ll be very happy to hear about the new ways in which you’ll be able to develop for Office and SharePoint.

Office and SharePoint 2013 feature a new Cloud App Model that embraces web standards, and allows you to build a new class of apps that combine web technologies and cloud services, right within Office and SharePoint. One of the primary investments for Office and SharePoint 2013 has been cloud enablement. Apps can be hosted in the cloud, which enables you to deploy, update and maintain your apps more quickly. You also have the ability to publish and sell your apps through a new Office Store, or distribute IT approved apps through an internal App Catalog within your organization. To learn more about the new Cloud App Model and Office Store, I recommend reading Ludovic Hauduc’s announcement and watching the videos on the new Apps for Office and SharePoint blog.

Introducing “Napa”

In sync with yesterday’s Office and SharePoint release, I’m happy to share that we released a preview of a new toolset called “Napa”, which is the easiest way to start building apps for the new Cloud App Model. As we set out to create developer tools for the new Cloud App Model, we took a fresh look at the overall solution we wanted to give to our customers. We wanted to provide a lightweight, in-browser experience, so that you could quickly build your SharePoint or Office web app in the same browser where they would run. Therefore, we created a first-class development environment called “Napa”, as an online companion to Visual Studio.

“Napa” is a free app for SharePoint. Since “Napa” is web based, you don’t need to install anything on your machine to start developing for Office and SharePoint. Just fire up your browser and start coding. As your application matures and you need more advanced tools, you can seamlessly switch to the more powerful, fully featured Visual Studio IDE, and continue developing there. To learn more about the latest advances in Visual Studio 2012 tooling for SharePoint, please visit MSDN.

Of course, in parallel with “Napa”, you can still continue using the existing extensibility models for Office and SharePoint, like VBA, COM, VSTO, and SharePoint solutions. (However, please note that these cannot be submitted to the new Office Store.)

Getting Started

Let’s take a peek at what this all looks like. To give “Napa” a try, first sign up for the Microsoft Office 365 Developer Preview at

When you sign up, a Developer site will be created for you. This site gives you your own instance of Office 365, where you can develop, deploy and test your Office 365 apps.

Next, you’ll want to install “Napa” in order to add the tools to your Developer Site.

(Please visit MSDN for the complete instructions on these “Getting Started” steps.)

  • 1
  • 4
  • 5