-1

I'm trying to create a formula in Google Sheets where in one column the product of two columns is calculated. I could simply type in each cell as an example in Column F:

=if(and(A1>0,C1>0),A1*C1,"")

but it would get tedious if there are 100 rows in those columns. I have tried:

=arrayformula(if(and(A1:A100>0,C1:C100>0),A1:A100*C1:C100,""
pnuts
  • 54,806
  • 9
  • 74
  • 122
  • Try this `=arrayformula(if(A1:A100>0,if(C1:C100>0,A1:A100*C1:C100,"")))` or `=array_constrain(arrayformula(if(A1:A>0,if(C1:C>0,A1:A*C1:C,""))),100,1)`. But you should read [ArrayFormula and β€œAND” Formula in Google Sheets](https://stackoverflow.com/questions/43710792/arrayformula-and-and-formula-in-google-sheets) to learn about the use of `AND` in an arrayformula. In fact, your question is a possible duplicate of that question. – Tedinoz Jan 08 '19 at 05:20
  • 2
    Possible duplicate of [ArrayFormula and "AND" Formula in Google Sheets](https://stackoverflow.com/questions/43710792/arrayformula-and-and-formula-in-google-sheets) – Tedinoz Jan 08 '19 at 05:21

1 Answers1

0

Try:

=arrayformula(if((A1:A100>0)*(C1:C100>0),A1:A100*C1:C100,""))
pnuts
  • 54,806
  • 9
  • 74
  • 122