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

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].


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)


Get help with this function in the community →