FunctionX 0.1.13

dotnet add package FunctionX --version 0.1.13
NuGet\Install-Package FunctionX -Version 0.1.13
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FunctionX" Version="0.1.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FunctionX --version 0.1.13
#r "nuget: FunctionX, 0.1.13"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FunctionX as a Cake Addin
#addin nuget:?package=FunctionX&version=0.1.13

// Install FunctionX as a Cake Tool
#tool nuget:?package=FunctionX&version=0.1.13

FunctionX

The FunctionX library implements Excel-like formula functionality in C#. It allows users to manipulate data in a similar way to Excel formulas. The library runs scripts in the Roslyn compiler to evaluate expressions.

Features

The FunctionX library offers the following features:

Usage

To use the FunctionX library:

  1. Call the Fx.Evaluate method to evaluate a formula.
  2. Pass the formula string and a dictionary of parameters.

Examples

Here are some examples of using the FunctionX library:

// Basic mathematical operation
var result = await Fx.EvaluateAsync("1 + 2 + 3");

// Calculate the average value in an array
var parameters = new Dictionary<string, object?>
{
    { "myArray", new object[] {1, 2, 3, 4, 5} }
};
var average = await Fx.EvaluateAsync("AVERAGE(@myArray)", parameters);

// Conditional logic
var parameters = new Dictionary<string, object?>
{
    { "value1", 10 },
    { "value2", 20 }
};
var ifResult = await Fx.EvaluateAsync("IF(@value1 > @value2, \"Yes\", \"No\")", parameters);

Implemented Functions

Function Name Description
SUM Calculates the sum of numeric values.
AVERAGE Calculates the average of numeric values.
MAX Finds the maximum value among numeric values.
MIN Finds the minimum value among numeric values.
COUNT Counts the number of numeric values.
COUNTA Counts the number of non-empty values.
AND Returns true if all values are true.
OR Returns true if at least one value is true.
NOT Returns true if the value is false.
XOR Returns true if an odd number of values are true.
IF Returns one of two values depending on a condition.
IFS Returns the result of the first true condition among multiple conditions.
SWITCH Returns a value based on given cases or provides a default value.
CONCAT Concatenates string values.
LEFT Returns a specified number of characters from the beginning of a string.
RIGHT Returns a specified number of characters from the end of a string.
MID Returns a specified number of characters from a string starting at a specified position.
TRIM Removes leading and trailing whitespace from a string.
UPPER Converts a string to uppercase.
LOWER Converts a string to lowercase.
PROPER Converts the first letter of each word in a string to uppercase.
REPLACE Replaces occurrences of a specified substring within a string with another substring.
LEN Returns the length of a string.
INDEX Returns the value at a specified position in an array or dictionary.
VLOOKUP Searches for a value in the first column of a range and returns a value in the same row from a specified column.
UNIQUE Returns an array of unique values with duplicates removed.
IFERROR Returns a value if an expression results in an error.

Installation

This library is not currently available via NuGet. To use the library, you will need to download the source code directly and include it in your project.

Requirements

  • netstandard2.1

Contributing

FunctionX is an open-source project. If you would like to contribute, please send a pull request or file an issue.

License

The FunctionX library is provided under the MIT license.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.13 87 4/2/2024
0.1.12 79 4/1/2024
0.1.11 83 4/1/2024
0.1.10 55 4/1/2024
0.1.9 62 4/1/2024
0.1.6 92 3/30/2024
0.1.5 88 3/26/2024
0.1.4 85 3/26/2024
0.1.3 78 3/26/2024
0.1.2 77 3/26/2024