Home > database >  Multiplying character-separated numbers in a cell with another cell (Distributive Property)
Multiplying character-separated numbers in a cell with another cell (Distributive Property)

Time:02-02

I have numbers in one cell that are separated by "-" and I want to multiply them by another number in another cell.

Example:

A: 12 - 6 - 8

B: 83

Doing MULTIPLY(SUM(SPLIT(A,"-")),B) is not mathematically correct. How can I do 12 * 83 8 * 83 8 * 83?

Thanks a lot.

CodePudding user response:

Here's what you can try:

=INDEX(LAMBDA(ζ,JOIN("-",ζ*SEQUENCE(1,COLUMNS(ζ))))(SPLIT(A1,"-")))

Update

=PRODUCT(SPLIT(A1,"-"))

Update 2

Let's say you have 83 in B1 and 12 - 6 - 8 in A1. Here's what you can try:

=LAMBDA(ζ,SUMPRODUCT(ζ,IF(ζ,B1)))(SPLIT(A1,"-"))
  • Related