View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Summing every third cell

I need to total every column cell starting at F3:HB3 also.

Every column? F3,G3,H3,I3,J3,K3,L3........HB3 ?

=SUM(F3:HB3)

The other formula you wanted only every 3rd column to be summed. If that's
also what you want with this new formula: sum every 3rd column from F3 to
HB3:

=SUMPRODUCT(--(MOD(COLUMN(F3:HB3),3)=0),F3:HB3)

I don't understand why this wouldn't work exactly the same.


The technique is the same but the condition is different because the range
is different.

The formula tests the column numbers to see if that particular column should
be included in the sum.

F3 = column() = 6
G3 = column() = 7
H3 = column() = 8
I3 = column() = 9

Using the MOD function we then need to find a divisor that returns a
specific value and this establishes a pattern that we can take advantage of.

MOD(COLUMN(F3),3) = 0
MOD(COLUMN(G3),3) = 1
MOD(COLUMN(H3),3) = 2
MOD(COLUMN(I3),3) = 0

So, we're telling the formula to sum those columns where the column number
returns a MOD of 0 when the divisor is 3.

Biff

"bthieson" wrote in
message ...

Okay I ended up using the first one and it worked perfectly. I have a
second totalling column on the end right next to the cell where I put
this formula. I assumed it would apply exactly the same, but it
definately does not.

I need to total every column cell starting at F3:HB3 also. I don't
understand why this wouldn't work exactly the same. If you have an
answer, I would definately appreciate it.

-Ben Thieson

Biff Wrote:
Hi!

Try this:

=SUMPRODUCT(--(MOD(COLUMN(E3:HA3),3)=2),E3:HA3)

If you might ever insert new columns before the start of the range:

=SUMPRODUCT(--(MOD(COLUMN(E3:HA3)-COLUMN(E3),3)=0),E3:HA)

Biff

"bthieson" wrote
in
message ...

I have quite a large excel sheet with about 210 columns. I need a sum

at
the end of each row for every third cell. I have tried a couple
different formulas that should work, but they always end up adding
other values in for some reason. The cells I need added go like so:
E3,H3......HA3. I'm sure a few of you out there have dealt with this
before. If you have a resolution, I would definately appreciate your
response.


--
bthieson

------------------------------------------------------------------------
bthieson's Profile:
http://www.excelforum.com/member.php...o&userid=34357
View this thread:

http://www.excelforum.com/showthread...hreadid=541295



--
bthieson
------------------------------------------------------------------------
bthieson's Profile:
http://www.excelforum.com/member.php...o&userid=34357
View this thread: http://www.excelforum.com/showthread...hreadid=541295