Forum Discussion
Excelstudent
Oct 22, 2022Copper Contributor
Multiply cells but ignore zeros and blanks cells
How do I multiple numbers in different cells BUT ignore blanks and zeros. (Please not this a long excel sheet). I want to multiple all the numbers from cell A1:H1 and put the answer in cell J in tota...
- Oct 22, 2022
Excelstudent If you are on a recent Excel version or on-line, this will work.
Or perhaps better to use:
=PRODUCT(FILTER(A2:H2,A2:H2<>0))
Then you capture everything except zeros and blanks.
PeterBartholomew1
Oct 22, 2022Silver Contributor
Using 365, I automatically go for a single dynamic range formula for the entire table. The key is to replace zeros and blanks with 1 which is the identity under multiplication.
= BYROW(IF(data, data, 1),
LAMBDA(row, PRODUCT(row))
)
If the Lambda function is named, this simplifies to
= BYROW(IF(data,data,1), Productλ)
... all of which looks nothing like Excel I realise!