Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I multiply only the cells that contain value?

Tags:

excel-2010

I have a Excel spreadsheet with 40 columns but the number of lines for each column varies. I need to multiply these cells by a value. How can I multiply only the cells that contain a value?

Thanks

like image 749
vvill Avatar asked Mar 22 '23 07:03

vvill


2 Answers

Depends a bit on what you want the result to be if the cell is blank.

If you have a a formula such as "=A1*B1*C1" but A1 could be blank, and you want just the product of B1 and C1 in that case, then you could amend the formula to something like:

=IF(ISBLANK(A1), 1, A1)*B1*C1

Otherwise it will treat it as zero and the overall product will always be zero.

like image 192
Linus Dillon Avatar answered May 03 '23 21:05

Linus Dillon


You could something like:

=IF(C5="",1,C5) * IF(D5="",1,D5) * IF(E5="",1,E5)

like image 25
JBrooks Avatar answered May 03 '23 21:05

JBrooks