# VBA Sumif cell is a number

#### kitkatjam

##### New Member
I am trying to sum a range, say column A, but only if the corresponding row in column B is a number. Column B contains either numbers or "". I can't figure out how to say it.

Sumifs(Range(A:A), Range(B:B), IsNumeric) was my first attempt but didn't work. Any help would be greatly appreciated, thank you!

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.
Just use ">0" for your criteria.
By the way, since there is only one conditions, SUMIF will do. No reason to need SUMIFS, i.e.
Code:
``=SUMIF(B:B,">0",A:A)``

Last edited:
=SUMIF(B2:B15,"<>*",A2:A15)

The problem is the "" come back as >0. Even though it's not a number, it's returning >0 = True so it ends up summing everything

This worked, thank you!!

Glad we could help & thanks for the feedback

The problem is the "" come back as >0. Even though it's not a number, it's returning >0 = True so it ends up summing everything
Hmmm...
It doesn't do that for me.

Using >0 works for me as well, as long as none of the values in col B are negative.
In fact >0 still works for me if the formula returns " " rather than "" in col B

Replies
1
Views
76
Replies
3
Views
537
Replies
9
Views
123
Replies
3
Views
186
Replies
4
Views
250

1,203,462
Messages
6,055,563
Members
444,799
Latest member
CraigCrowhurst

### 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