Search code examples
google-sheetsspreadsheetarray-formulasfinance

How to use ARRAYFORMULA for REPLACE function in Google Sheets?


G'day, I'm working on a finance project using Google Sheets and I think I'm getting in a bit over my head.

I am trying to reformat a list of transactions by truncating the date (mm/dd/yyyy and a space) so that I can sort them alphabetically. I tried to do this quickly using an ARRAYFORMULA, but it did not seem to work as I wanted to. I'm using it in conjunction with the REPLACE formula:

=ARRAYFORMULA(REPLACE(A2, 1, 11, "")

I've made an spreadsheet here to exemplify the problem.

It doesn't throw an error, but it also doesn't generate a full array. I would be most grateful if someone could explain why this isn't working, or perhaps clarify the way ARRAYFORMULA function is supposed to work.

Thanks!


Solution

  • Try this

    =Arrayformula(TRIM(REGEXREPLACE(A2:A,"^\S+","")))
    

    enter image description here