Thread: excel formula
View Single Post
 
Old 05-15-2014, 06:24 PM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Got it: You want to add up the figures in column 26 (or column Z, if you're using that old-fashioned and vastly inferior A1 notation) but only from those rows that in column 1 have a text value ending in " Totals:". Do you want it all the way down, or just the first part that you highlighted? No matter; I would use SUMIF.

SUMIF wants to know three things: 1) The "if" column, that is, the one you're checking to see whether the number should be included in the total; 2) The condition, that is, what has to be in the "if" column to qualify; and the sum range, the column that holds the actual numbers to be added up. Column 1 (or A) is the first argument, and column 26 (or Z) is the third.

But what do you put in the second argument, for the condition? You can't just put "Totals:"; none of the values in column one are equal to "Totals:", they just end in "Totals:". And unless someone else here has a brighter idea than I do (Peco? Paul?), you can't put that straight into the SUMIF function.

So you'll need to create an extra "helping" column, probably at the right. Suppose in column 30 you put this formula:
Code:
=RIGHT(RC1,8)=" Totals:"
That puts TRUE on all the rows that you want included in your sum. Then your "if" column is 30, like this:
Code:
=SUMIF(C30,TRUE,C26)
If you're using A1 notation, the same thing look only slightly more complicated:
Code:
=RIGHT(A<row>,8)=" Totals:"
=SUMIF(AD:AD,TRUE,Z:Z)
How's that?
Reply With Quote