# Problem with formula

#### one_more_cave_dweller

##### Board Regular

I want cell a20 to return the value of cells c1:c10 but only if cells d1:d10 contain a value. I tried =SUMIF(d\$1:\$d\$10,">0",\$c\$1:\$c\$10) but that will not work if d1:d10 contains a negative number. I also tried =SUMIF(d\$1:\$d\$10,"<>0",\$c\$1:\$c\$10) but that returns values from a1:a10 and b1:b10 also. How can I get it to pick up either positive or negative numbers for only c1:c10?

Thanks ray:

### Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

#### vconfused

##### Well-known Member
So, as long as there is a number in any cell from D1 to D10, then we want to sum whatever is in C1 through C10?

Or do we only want to sum the numbers in C1 throuth C10 only if there is something in the same row in D10?

#### Tazguy37

##### MrExcel MVP
Maybe this?:
=SUMIF(D\$1:\$D\$10,"<>",\$C\$1:\$C\$10)

Hope that helps!

#### vconfused

##### Well-known Member
If the latter, then you could use:

=SUMIF(D1:D10,"<>"&"",C1:C10)

#### one_more_cave_dweller

##### Board Regular
Thanks again TAZ!!!

Replies
7
Views
315
Replies
10
Views
699
Replies
3
Views
315
Replies
3
Views
281
Replies
3
Views
1K

1,181,993
Messages
5,933,157
Members
436,882
Latest member
Kiddo456

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back