SUM CELLS (not adjacent) and some have #N/A

MixedUpExcel

Board Regular
Joined
Apr 7, 2015
Messages
222
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have multiple Rows (within a Column) that I want to SUM but some have #N/A in them.

When I have the formula to create the Total, I want to be able to drag it across 24 Columns.

I have found 2 examples - both work in various situations but not my specific one.

Can anyone suggest a working solution that I can create in the first Column and then drag to the right?

Code:
=SUMIF(C69:C112,"<>#N/A")
- Works if I need to SUM up all values in the Column (but in this case I just need to SUM up the PACK Values)

Code:
[COLOR=#333333]=SUM(SUMIF(INDIRECT({"D4","E6","F8","G10","H12","I14","J16","K18","L20","M22","N24","O26"}),"<>#N/A"))[/COLOR]
- Would work but I can't select the Cells as they are in the curly brackets (array) so I can't then drag them across all the other Columns

Example Table:

2017
2018
JANFEBMARAPRMAYJUNJULAUGSEPTOCTNOVDECJANFEBMARAPRMAYJUNJULAUGSEPOCTNOV
Pack 1250
Component 1VALUE
Component 2VALUE
Pack 2175
Component 1VALUE
Component 2VALUE
Component 3VALUE
Pack 93
Component 1VALUE
Component 2VALUE
Component 3VALUE
Component 4VALUE
Component 5VALUE
Pack #N/A
Component 1#N/A
Component 2#N/A
Component 3#N/A
Pack #N/A
Component 1#N/A
Component 2#N/A
Component 3#N/A
Component 4#N/A
Pack 374
Component 1VALUE
Component 2VALUE
Component 3VALUE
Component 4VALUE
Pack 187
Component 1VALUE
Component 2VALUE
Component 3VALUE
Pack #N/A
Component 1#N/A
Component 2#N/A
Component 3#N/A
Component 4#N/A
Component 5#N/A
PACK TOTAL1079

<tbody>
</tbody>

Thanks in advance.

Simon
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
This should do it,

=SUMIFS($C$69:$C$112,$A$69:$A$112,"Pack*",$B$69:$B$112,"<>#N/A")
 
Upvote 0
try

=SUM(IF(ISERROR(C69:C112),"",C69:C112))

confirm with shift-control-enter together
 
Upvote 0
This should do it,

=SUMIFS($C$69:$C$112,$A$69:$A$112,"Pack*",$B$69:$B$112,"<>#N/A")

Thanks cunningAce, unfortunately, I only used Pack to illustrate that I wanted to SUM the values against the PACK - the Packs actually have individual names.

So I'm not going to be able to use this formula.

Thanks anyway.

S.
 
Upvote 0
Hi,

I feel I had better make a few more notes on my above table.

Packs - these are unique names, Pack is just to illustrate that my Pack Name is against the Value I want to SUM up
Component - these will also be unique name and are what make up the value of the Pack
VALUE - this represents differing values, unless it's #N/A but I don't want to SUM up the various values against the Components, only against the PACKS.

Hope that clears things up a little bit.

AlanY,

I've tried your formula and as per my update above, this won't work.

Thanks anyway for throwing in a suggestion.

Simon
 
Upvote 0
it works for me


Excel 2013/2016
ABCD
12017
2JANFEBMAR
3Pack 1250
4Component 1VALUE
5Component 2VALUE
6Pack 2175
7Component 1VALUE
8Component 2VALUE
9Component 3VALUE
10Pack93
11Component 1VALUE
12Component 2VALUE
13Component 3VALUE
14Component 4VALUE
15Component 5VALUE
16Pack#N/A
17Component 1#N/A
18Component 2#N/A
19Component 3#N/A
20Pack#N/A
21Component 1#N/A
22Component 2#N/A
23Component 3#N/A
24Component 4#N/A
25Pack374
26Component 1VALUE
27Component 2VALUE
28Component 3VALUE
29Component 4VALUE
30Pack187
31Component 1VALUE
32Component 2VALUE
33Component 3VALUE
34Pack#N/A
35Component 1#N/A
36Component 2#N/A
37Component 3#N/A
38Component 4#N/A
39Component 5#N/A
40PACK TOTAL1079
41
421079
Sheet2
Cell Formulas
RangeFormula
B42{=SUM(IF(ISERROR(B3:B39),"",B3:B39))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Cant you add a column to illustrate whether the row contains 'Pack' data or 'Component Data. That way the formula could be used?
 
Upvote 0
Hi AlanY,

You're formula does work but only if there is no actual numbers where I have put Value.

As per a more recent post where I realised that I hadn't been clear.. I put this:

Packs - these are unique names, Pack is just to illustrate that my Pack Name is against the Value I want to SUM up
Component - these will also be unique name and are what make up the value of the Pack
VALUE - this represents differing values, unless it's #N/A but I don't want to SUM up the various values against the Components, only against the PACKS.

If I replace any of the VALUE's in my table to a number (which is what I have on my spreadsheet) then those numbers also get added into the Total - which I don't want.

I need to have a formula where I can select the cells under each month (one column at a time) next to the Pack Name (not the Component) and then get a Total, irrespective of whether some or none have the #N/A.

I've replaced Value in the table below but still have the same numbers next to the packs and I still want to be able to get to 1079


A
BCD
12017
2JANFEBMAR
3Pack 1250
4Component 1130
5Component 2120
6Pack 2175
7Component 175
8Component 260
9Component 340
10Pack93
11Component 163
12Component 210
13Component 310
14Component 46
15Component 54
16Pack#N/A
17Component 1#N/A
18Component 2#N/A
19Component 3#N/A
20Pack#N/A
21Component 1#N/A
22Component 2#N/A
23Component 3#N/A
24Component 4#N/A
25Pack374
26Component 1150
27Component 2120
28Component 350
29Component 454
30Pack187
31Component 1100
32Component 247
33Component 340
34Pack#N/A
35Component 1#N/A
36Component 2#N/A
37Component 3#N/A
38Component 4#N/A
39Component 5#N/A
40PACK TOTAL1079
41
421079

<tbody>
</tbody><thead>
</thead><tbody>
</tbody>
Thanks.
 
Upvote 0
Hi cunningAce,

Please see my last post to AlanY.

Hope that might clear it up - I'm just working one column at a time, then I hope to be able to drag the formula over which is used to generate the Total across all other months.

I just want to Total those which are in Bold which are against the Packs but the name Pack will change in my real life situation - that is just to indicate that that Row is what I need to SUM.

Thanks.
 
Upvote 0
but @cunningAce's suggestion in post#2 works,


Excel 2013/2016
ABCD
12017
2JANFEBMAR
3Pack 1250
4Component 1130
5Component 2120
6Pack 2175
7Component 175
8Component 260
9Component 340
10Pack93
11Component 163
12Component 210
13Component 310
14Component 46
15Component 54
16Pack#N/A
17Component 1#N/A
18Component 2#N/A
19Component 3#N/A
20Pack#N/A
21Component 1#N/A
22Component 2#N/A
23Component 3#N/A
24Component 4#N/A
25Pack374
26Component 1150
27Component 2120
28Component 350
29Component 454
30Pack187
31Component 1100
32Component 247
33Component 340
34Pack#N/A
35Component 1#N/A
36Component 2#N/A
37Component 3#N/A
38Component 4#N/A
39Component 5#N/A
40PACK TOTAL1079
Sheet2
Cell Formulas
RangeFormula
B40{=SUMIFS(B3:B39,A3:A39,"Pack*",B3:B39,"<>#N/A")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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