Razor

This feature is free. Check out the awesome benefits of becoming a Pro User.

=Razor(string template, {object arguments},
 ...) : string    


Purpose

Enables Razor templating from ASP.MVC in Excel.

This can be very useful for more advanced string concatenation using the full power of C#.

Arguments are are available through @Model.Args[n].


Examples

A1: Niels
B2: Awesome
=Razor("@Model.Args[0] is @Model.Args[1]";A1:B1) => "Niels is Awesome"

Join a range of cells with "," but remove empty cell first:

=Razor("@string.Join("","",((object[])Model.Args).Where(e => 
!string.IsNullOrEmpty((string)e)))";A1:A3)

See

Related Functions


Get help with this function in the community →