The group is a variable that may be changed at any time.

We need to create this as part of the formula.

The easiest way to solve this problem is with theXLOOKUP function.

Excel formula: Find longest string

Both approaches are explained below.

The result is “Jonathan”, which contains 8 characters and is the longest name in group A.

The result is returned directly to the MAX function, which returns 8.

Excel formula: Get information about max value

XLOOKUP supports approximate and exact matching, wildcards (* ?)

you’re able to use INDEX to retrieve individual values, or entire rows and columns.

MATCH supports approximate and exact matching, andwildcards(* ?)

Excel formula: Position of max value in list

MAX ignores empty cells, the logical values TRUE and FALSE, and text values.

LEN will also count characters in numbers, but number formatting is not included.

Excel XLOOKUP function

Excel INDEX function

Excel MATCH function

Excel MAX function

Excel LEN function

Article image

Article image

Article image