andio
andio

Reputation: 1778

google sheet : array formula for a single cell

I have a cell A1 contains : 1,5,7

I want to a create a formula in cell A2 which output like this : 8s,40s,56s

So i want to grab value from A1, split it by ',' so then i get the array contains :

1
5
7

I will then multiply each element by 8:

1x8 = 8
5x8 = 40
7x8 = 56

Then add 's' to the output as follow :

8s
40s
56s

Last, i want to concatenate them back using ',' as separator to become :

8s,40s,56s

Thanks

Upvotes: 0

Views: 73

Answers (2)

player0
player0

Reputation: 1

use:

=INDEX(JOIN(",", SPLIT(A1, ",")*8&"s"))

enter image description here

Upvotes: 2

Aresvik
Aresvik

Reputation: 4620

Try this:

arrayformula(textjoin(",",1,transpose(split(A1,","))*8&"s"))

Upvotes: 1

Related Questions