VBA Sumif cell is a number

kitkatjam

New Member
Joined
Nov 30, 2018
Messages
11
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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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:
Upvote 0
How about
=SUMIF(B2:B15,"<>*",A2:A15)
 
Upvote 0
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
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top