Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
JC
 
Posts: n/a
Default SUM every other column

I have a large table where I would like to get the sum of
every other column. My current method is to use the +
key and click on every other cell.

Is there a better way?

Thanks,
JC
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Something like this may work for you:

=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=0),A1:K1)
or
=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=1),A1:K1)

(first formula gives even numbered columns, second gives odd numbered columns)

JC wrote:

I have a large table where I would like to get the sum of
every other column. My current method is to use the +
key and click on every other cell.

Is there a better way?

Thanks,
JC


--

Dave Peterson
  #3   Report Post  
JC
 
Posts: n/a
Default

Works like a charm. Thanks Dave.

JC
-----Original Message-----
Something like this may work for you:

=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=0),A1:K1)
or
=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=1),A1:K1)

(first formula gives even numbered columns, second gives

odd numbered columns)

JC wrote:

I have a large table where I would like to get the sum

of
every other column. My current method is to use the +
key and click on every other cell.

Is there a better way?

Thanks,
JC


--

Dave Peterson
.

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

I don't think I like this formula--even though it worked ok for you.

If you insert a single column in that range, then your formula won't sum the
columns that you want. (It's happened to a workbook I shared with a co-worker.
He inserted an extra column to add a short description--it screwed up his
results.)

I think I'd add a header row (row 1???). Then put an indicator to add those
cells that have the indicator in it.

=sumproduct(--(a1:k1="x"),a2:k2)

Then if you insert/delete columns, it might be less work.

JC wrote:

Works like a charm. Thanks Dave.

JC
-----Original Message-----
Something like this may work for you:

=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=0),A1:K1)
or
=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=1),A1:K1)

(first formula gives even numbered columns, second gives

odd numbered columns)

JC wrote:

I have a large table where I would like to get the sum

of
every other column. My current method is to use the +
key and click on every other cell.

Is there a better way?

Thanks,
JC


--

Dave Peterson
.


--

Dave Peterson
  #5   Report Post  
Jonathan Cooper
 
Posts: n/a
Default

Wouldn't a SUMIF work just as well and probably be faster?

"Dave Peterson" wrote:

I don't think I like this formula--even though it worked ok for you.

If you insert a single column in that range, then your formula won't sum the
columns that you want. (It's happened to a workbook I shared with a co-worker.
He inserted an extra column to add a short description--it screwed up his
results.)

I think I'd add a header row (row 1???). Then put an indicator to add those
cells that have the indicator in it.

=sumproduct(--(a1:k1="x"),a2:k2)

Then if you insert/delete columns, it might be less work.

JC wrote:

Works like a charm. Thanks Dave.

JC
-----Original Message-----
Something like this may work for you:

=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=0),A1:K1)
or
=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=1),A1:K1)

(first formula gives even numbered columns, second gives

odd numbered columns)

JC wrote:

I have a large table where I would like to get the sum

of
every other column. My current method is to use the +
key and click on every other cell.

Is there a better way?

Thanks,
JC

--

Dave Peterson
.


--

Dave Peterson



  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

Yep.



Jonathan Cooper wrote:

Wouldn't a SUMIF work just as well and probably be faster?

"Dave Peterson" wrote:

I don't think I like this formula--even though it worked ok for you.

If you insert a single column in that range, then your formula won't sum the
columns that you want. (It's happened to a workbook I shared with a co-worker.
He inserted an extra column to add a short description--it screwed up his
results.)

I think I'd add a header row (row 1???). Then put an indicator to add those
cells that have the indicator in it.

=sumproduct(--(a1:k1="x"),a2:k2)

Then if you insert/delete columns, it might be less work.

JC wrote:

Works like a charm. Thanks Dave.

JC
-----Original Message-----
Something like this may work for you:

=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=0),A1:K1)
or
=SUMPRODUCT(--(MOD(COLUMN(A1:K1),2)=1),A1:K1)

(first formula gives even numbered columns, second gives
odd numbered columns)

JC wrote:

I have a large table where I would like to get the sum
of
every other column. My current method is to use the +
key and click on every other cell.

Is there a better way?

Thanks,
JC

--

Dave Peterson
.


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I sort by row instead of by column? PercivalMound Excel Worksheet Functions 7 August 28th 06 10:41 PM
Format cell in column B based on value in the next cell (column c) Nicole Excel Discussion (Misc queries) 7 May 18th 05 10:19 PM
how can i fill blank cells in column with abc while the right col. khurram saddique Excel Discussion (Misc queries) 2 February 12th 05 03:25 PM
Copying the contents of a column into a chart Richard Excel Worksheet Functions 1 November 16th 04 02:39 PM
How to calculate the data in excel 2002 including only the last 9. TylerMaricich Excel Worksheet Functions 6 November 8th 04 07:27 AM


All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"