Home > Software engineering >  Any easy way to simplify a repetitive formula
Any easy way to simplify a repetitive formula

Time:10-01

Do you have any suggestions on how to reduce the effort on typing the formula below

={"Header";ARRAY_CONSTRAIN(ARRAYFORMULA(IFERROR(dosomething(),"-")),COUNTA(A2:A),1)}

I make calculations everyday on several files, and I have to do this for most of the columns to auto-calculate data. I type it several times.

Is there any way to reduce the effort?

CodePudding user response:

You can reduce it by creating a named function.

Create a function like:

CUSTOMCUT:

Arguments: arr
Description: The array to cut up to the count of Sheet1!A2:A
Formula definition: ={"Header";ARRAY_CONSTRAIN(ARRAYFORMULA(IFERROR(arr,"-")),COUNTA(Sheet1!A2:A),1)}

Then you can use:

=CUSTOMCUT(dosomething())

Related:

Avoiding traditional usage of arrayformula

  • Related