Apply formula to the entire column

后端 未结 11 1335
不知归路
不知归路 2021-01-30 19:03

I\'m trying to recode all the zip code from Column A into Column B with the formula:

=TEXT(A1,\"00000\")

Like this:

11条回答
  •  星月不相逢
    2021-01-30 19:41

    Let's say you want to substitute something in an array of string and you don't want to perform the copy-paste on your entire sheet.

    Let's take this as an example:

    • String array in column "A": {apple, banana, orange, ..., avocado}
    • You want to substitute the char of "a" to "x" to have: {xpple, bxnxnx, orxnge, ..., xvocado}

    To apply this formula on the entire column (array) in a clean an elegant way, you can do:

    =ARRAYFORMULA(SUBSTITUE(A:A, "a", "x"))
    

    It works for 2D-arrays as well, let's say:

    =ARRAYFORMULA(SUBSTITUE(A2:D83, "a", "x"))
    

提交回复
热议问题