I have two columns. The values in the first one are either blank or have a 1. The values in the second one is a number. I also have a variable field.

At the bottom of each column, I'd like to have a "total" field, which checks if there is a value (of 1) in the first column, and if there is, adds this up from the value of the second column (on the same row) and multiplies it by the variable.

for example:

```
variable 10
name1 name2 counter
1 2
1 3
1 1 3
1 4
totals
100 50
```

since name1 has 3 1's in it's column, it takes each value from the counter column, and multiplies it by the variable, and outputs the total

I'm sorry if this has been asked, I've tried searching but I have a hard time understanding the excel syntaxes.

Thanks!