Simple Addition to ignore #Value & #Div/0!

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,523
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am looking for a simple addition formula to calculate cells G5:G1004 but ignoring the #Value & #Div/0!

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
If there are no negative numbers, then you can use

=SUMIF(G5:G1004,">0")

If there are negatives, then
=SUM(SUMIF(G5:G1004,{"<0",">0"}))
 
Upvote 0

farmerscott

Well-known Member
Joined
Jan 26, 2013
Messages
818
Office Version
  1. 365
Platform
  1. Windows
ADVERTISEMENT
Hi Jonmo,

I am just trying to learn something from someone more knowledgeable than myself.....

1. why the need for the {} to take the criteria for the sumif and not just ()?
2. why do you need to sum the sumif?


thanks

FarmerScott
2.
 
Upvote 0

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
If you are using Excel 2010 or later you can use AGGREGATE function like this

=AGGREGATE(9,6,G5:G1004)

The 9 indicates "SUM" and the 6 indicates that errors should be ignored
 
Upvote 0

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
ADVERTISEMENT
The combination of the {} and the SUM makes it process like an array.
It basically creates 2 simif formulas, 1 for <=0, another for >=0
The SUM sums the result of the 2.
 
Upvote 0

farmerscott

Well-known Member
Joined
Jan 26, 2013
Messages
818
Office Version
  1. 365
Platform
  1. Windows
Hi Jonmo,

thanks for that.

Does sumif only take 1 criteria? Does your fcombination of formula/s then allow you to do 2 or more? Is that what you were thinking?

i need to get a better handle on arrays than I do.

can you think of any other formulas that you could use in the same context?

cheers

FarmerScott
 
Upvote 0

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Yes, And Yes.

Sumif only takes 1 criteria.
This formula syntax allows multiple criteria
But it's not as flexible as you might be hoping.
It can only do an OR type of criteria, and on the same column of data.

So basically you can do If ColA = "A" or "B" or "C" etc..
But you can't do
If ColA = "A" and/or ColB = "A"
 
Upvote 0

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
can you think of any other formulas that you could use in the same context?

cheers
FarmerScott

Yes, you can do countif (same as sumif)
And you can do vlookup...this is actually pretty cool

=SUM(VLOOKUP(A1,B:D,{2,3},FALSE))
However, this must be array entered with CTRL+SHIFT+ENTER
 
Upvote 0

Forum statistics

Threads
1,195,848
Messages
6,011,946
Members
441,657
Latest member
Diupsy

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
Top