is_range() tests whether or not an Excel formula is a range. A formula like A1 is a range, whereas a formula like MAX(A1,2) is not. Formulas are not evaluated, so it returns FALSE for formulas that would eventually resolve to arrange (e.g. INDEX(A1:A10,2)) but that are not immediately a range.

is_range(x)

## Arguments

x character vector of formulas

## Examples

x <- c("A1", "Sheet1!A1", "[0]Sheet1!A1", "A1,A2", "A:A 3:3", "MAX(A1,2)")
is_range(x)
#> [1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE