Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Multiple substitutions in a table

$
0
0

Suppose we have a table like the following :

ABCDEFG
117-01DO22-06DO17-0122-0622-06
222-0622-0617-01DO22-0609-1709-17
309-17DO22-0622-06DO17-0117-01
417-0122-0617-01DO22-06DO22-06
522-06DO09-1709-1709-1722-0609-17
609-1709-17DO22-06DO09-1722-06

And I would like to substitute the following values more efficiently.

  • "09-17" ---> "07-15".
  • "17-01" ---> "15-23"
  • "22-06" ---> "20-04"

I managed to do it with the following solution (not so efficiently as it makes lot of loops)

=ARRAYFORMULA(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE({B2:G6},"09-17","07-15"),"17-01","15-23"),"22-06","20-04"))

I was wondering how this can be done more efficiently when the dimensions of the table are too large.

Any idea how to limit unnecessary repetitions?


Viewing all articles
Browse latest Browse all 9782

Trending Articles