3305 Main Street Ste 019 Vancouver, WA 98663

LRFilter Function

The LRFilter function is useful to work around the maximum formula length limit of Excel by allowing you to break a single formula into smaller pieces. The LRFilter function was originally created to address Liberty Reports formulas with complex filter arguments, but it can be used for any text argument in any Excel formula.

Syntax

LRFilter( filter template , enclosers, arg1 , [ ... argn ] )

The LRFilter function syntax has these parts:

Value Description
filter template Required. This argument specifies a pattern containing literal text and replacement markers.
enclosers Required. This argument specifies how your filter template will identify replacement markers.
arg1 ... argn Optional. This is a comma-delimited list of values used to replace the markers in the filter template. Quite often you will use cell references to columns on the current row that contain key values for your filter. If no arguments are specified, then the filter template is returned unchanged.

Remarks

Replacement markers refer to the ordinal position of the associated argument. Use the enclosers to identify that a number N is a marker for the Nth argument. For example,

LRFilter("My [1] has [2].", "[]", "dog", "fleas")

Returns

My dog has fleas.

because the enclosers argument indicates that any number enclosed in square brackets [ ] is a marker that refers to one of the args, so [1] refers to dog and [2] refers to fleas.