# Using sumif for non contiguous ranges WITHOUT naming them

#### Meredith

##### New Member
For example, I want to find the sum for cells A5, A7, A9, and A11.

But A7 is a vlookup that isn't returning a value. So I want to get the sum of A5,A7,A9,A11, if they are >0

is there a way to do this without naming the range? There will be about 4000 ranges if i have to name them.

### Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try...

=SUMPRODUCT(--(MOD(ROW(A5:A100)-ROW(A5),2)=0),A5:A100)

Hope this helps!

not sure if i understand

I am not very familiar with the sum product and mod functions. How would they allow me to do a sum of only numerical values in a non contiguous range? is it that the remainder of the cells that have errors in them is zero?

I have several customer pages that allow sales guys to input sales by month by product for each customer

So let's say I am trying to get the total sales by product for each month of quarter 1.

I would have each product listed on the left with their unique code. I then have, going across the columns, vlookups for the product on each customer page. Problem is, not all customers have the same products, so sometimes the vlookups come back with #VALUE unless I do an if statement with an iserror.. which takes up so much memory and slows down my computer drastically ( especially if working remotely) so I don't want to do that.

so, let's say the data is in D6, H6,L6, P6, T6 and X6. How would you put that in the formula you gave?

Re: not sure if i understand

I would have each product listed on the left with their unique code. I then have, going across the columns, vlookups for the product on each customer page. Problem is, not all customers have the same products, so sometimes the vlookups come back with #VALUE unless I do an if statement with an iserror.. which takes up so much memory and slows down my computer drastically ( especially if working remotely) so I don't want to do that.

so, let's say the data is in D6, H6,L6, P6, T6 and X6. How would you put that in the formula you gave?

VLOOKUP should not be returning the #VALUE error.

Re: not sure if i understand

so, let's say the data is in D6, H6,L6, P6, T6 and X6. How would you put that in the formula you gave?

Try...

=SUM(IF(MOD(COLUMN(D6:X6)-COLUMN(D6),4)=0,IF(ISNUMBER(D6:X6),D6:X6)))

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

Okay, #ref not #value, sorry I misspoke.

Domenic, there are values in E6,I6,M6, etc that i do NOT want to add.

There are three months of data

I want to add all Jan,Feb, and Mar separately.

I am beginning to think I just need to adjust the way I've pulled the informatio nso all januaries are together. that way it is contiguous.

Domenic, there are values in E6,I6,M6, etc that i do NOT want to add.

The formula won't add those values. Did you confirm the formula with CONTROL+SHIFT+ENTER, not just ENTER?

Okay, #ref not #value, sorry I misspoke.

Meredith,

You may also want to re-visit the VLOOKUP formula as the #REF error is returned because the column to return is outside of your table array. The information you seek maybe in your table array.

THANKS

I hadn't realized that the 4 went ot every fourth column. That works perfectly!
This forum rocks.

Replies
3
Views
225
Replies
1
Views
197
Replies
12
Views
468
Replies
10
Views
567
Replies
11
Views
331

1,221,153
Messages
6,158,233
Members
451,477
Latest member
CWebbers

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