Hello, I have a formula question... I am looking to get the sum of a row, excluding every other column. I'm currently working with the following formula, but need to also exclude zero values, as I get an #Div/0! if a cell is unused or of zero value. PLEASE HELP!!!
=SUMPRODUCT((MOD(COLUMN(B12:CK12),2)*B12:CK12)*(B12:CK12>0),B12:CK12)
Are you sure?
I tested it just now and got results with 0's and blanks in the columns...
Do you have an error in one of those columns.
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Weezy, the above assertion is not correct.
In this particular calculation a #DIV/0! could only result from an underlying error value.
(there are no division calculations taking place within the SUMPRODUCT itself)
The "Numbers stored as Text" error (assuming explicit coercion) would generally* generate #VALUE! errors (as opposed to #DIV/0!)
*unless other errors are encountered first thus taking precedence
If you can't correct for underlying errors at source (ie handling the #DIV/0!) then you can use an Array rather than SUMPRODUCT, ie:
=SUM(IF(MOD(COLUMN(B12:CK12),2)*ISNUMBER(B12:CK12),IF((B12:CK12>0),B12:CK12)))
confirmed with CTRL + SHIFT + ENTER
However, accounting for underlying errors at source is generally advised.
Last edited by DonkeyOte; 06-16-2010 at 02:41 AM. Reason: reworded
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks