Home » excel » excel – How to get length of FORMULATEXT() in SUMPRODUCT()?

excel – How to get length of FORMULATEXT() in SUMPRODUCT()?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I need to count all cells with a certain length of FORMULATEXT(), I decided to go for SUMPRODUCT() as I believe you can’t count by length while using COUNTIF(). The formula that I use while counting cells of certain length is this one:

=SUMPRODUCT(--(LEN(AV3:AV201)<>7))

Adding the FORMULATEXT() function resulted in error.
VBA is unfortunately out of question as our accounting system can’t recognise .xlsm files.

How to&Answers:

Try this array formula with CSE,

=SUMPRODUCT(--(IFERROR(LEN(FORMULATEXT(AV3:AV201)), 7)<>7))

If FORMULATEXT sees text, numbers or a blank cell, it returns #N/A. IFERROR can return those as LEN 7 so they are not included in the count.

Without compensating for errors, your formula will only work if AV3:AV201 contains a formula in each cell.