Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Adding cells in every other column

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Adding cells in every other column

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Adding cells in every other column

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding cells in every other column

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark



--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Adding cells in every other column

Awesome Dave, that worked!

I appreciate it very much. After seven years of working with excel you
would think I would know/remember these things....

Thanks again.

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Adding cells in every other column

Dave, one more quick question. How would I change your formula to do the
same thing, but have it add up columns G,I,k etc, in other words one column
before the h column - as in your formula provided. I tried to change your
formula from H7 to G7 but I get the same result? Your formula starts with
the seventh column and adds ever other column. I also need to have a formula
that starts in the sixth column and adds every other column thereafter. I'm
confused (still).

Thanks,

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding cells in every other column

This kind of formula that depends on the column number that contains the value
always scares me. If columns are inserted/deleted, it could break the
formula--or even worse, the formula may work--but just show a value that isn't
what you really want.

I think I'd add a row (and hide it later).

Then use an indicator in that row.

=sumif($h$1:$iv$1,"$",$h7:$iv7)





MarkT wrote:

Awesome Dave, that worked!

I appreciate it very much. After seven years of working with excel you
would think I would know/remember these things....

Thanks again.

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding cells in every other column

=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

The =mod(..., 2) will return a 0 or 1. 1 means you're in an odd numbered
column. 0 means you're in an even numbered column.

But I'm confused about what you want. Column G is column 7. That's an odd
number.

You could add the odd numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=1),g7:IV7)

You could add the even numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

====
I still like the (hidden) row of indicators and =sumif().

MarkT wrote:

Dave, one more quick question. How would I change your formula to do the
same thing, but have it add up columns G,I,k etc, in other words one column
before the h column - as in your formula provided. I tried to change your
formula from H7 to G7 but I get the same result? Your formula starts with
the seventh column and adds ever other column. I also need to have a formula
that starts in the sixth column and adds every other column thereafter. I'm
confused (still).

Thanks,

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Adding cells in every other column

Sorry for the confusion, my fault, I changed my spreadsheet around a bit
inbetween postings, I moved some columns around.

I always try to learn something when I get stuck, that's why I appreicate
everyone's response to my various questions.

What would happen if I wanted to count every third column? Is this possible
since with the formula result being true or false? True being even, false
being odd?

As far as the hidden row, I understand your concern, but I have hundres of
rows of inventory items, so I would have to have hundreds of rows of
indicators. It's shouldn't be a problem with adding rows, that side of the
spreasheet is fairly basic and I don't see any changes ever being made.

Whenever I make a change to a spreasheet like that, I usually start over
from scratch and do things differently, more efficiently, etc.

In any event, again, thanks very much for your help I appreicate it very much.

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

The =mod(..., 2) will return a 0 or 1. 1 means you're in an odd numbered
column. 0 means you're in an even numbered column.

But I'm confused about what you want. Column G is column 7. That's an odd
number.

You could add the odd numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=1),g7:IV7)

You could add the even numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

====
I still like the (hidden) row of indicators and =sumif().

MarkT wrote:

Dave, one more quick question. How would I change your formula to do the
same thing, but have it add up columns G,I,k etc, in other words one column
before the h column - as in your formula provided. I tried to change your
formula from H7 to G7 but I get the same result? Your formula starts with
the seventh column and adds ever other column. I also need to have a formula
that starts in the sixth column and adds every other column thereafter. I'm
confused (still).

Thanks,

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

Dave Peterson


--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding cells in every other column

You wouldn't need hundreds of rows of indicators. You'd just check the single
row in the formula.

Notice the $ signs around $h$1:$iv$1 in this formula:
=sumif($h$1:$iv$1,"$",$h7:$iv7)

That means that this range won't change when you copy the formula to other
locations.

=mod(...,2)
will return 0 or 1
=mod(...,3)
will return 0, 1, or 2
=mod(...,18)
will return whole numbers between 0 and 17.

So you can change this portion:
MOD(COLUMN(g7:IV7),2)=0
to
MOD(COLUMN(g7:IV7),3)=0 (or 1 or 2--depending on what column you want)

MarkT wrote:

Sorry for the confusion, my fault, I changed my spreadsheet around a bit
inbetween postings, I moved some columns around.

I always try to learn something when I get stuck, that's why I appreicate
everyone's response to my various questions.

What would happen if I wanted to count every third column? Is this possible
since with the formula result being true or false? True being even, false
being odd?

As far as the hidden row, I understand your concern, but I have hundres of
rows of inventory items, so I would have to have hundreds of rows of
indicators. It's shouldn't be a problem with adding rows, that side of the
spreasheet is fairly basic and I don't see any changes ever being made.

Whenever I make a change to a spreasheet like that, I usually start over
from scratch and do things differently, more efficiently, etc.

In any event, again, thanks very much for your help I appreicate it very much.

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

The =mod(..., 2) will return a 0 or 1. 1 means you're in an odd numbered
column. 0 means you're in an even numbered column.

But I'm confused about what you want. Column G is column 7. That's an odd
number.

You could add the odd numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=1),g7:IV7)

You could add the even numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

====
I still like the (hidden) row of indicators and =sumif().

MarkT wrote:

Dave, one more quick question. How would I change your formula to do the
same thing, but have it add up columns G,I,k etc, in other words one column
before the h column - as in your formula provided. I tried to change your
formula from H7 to G7 but I get the same result? Your formula starts with
the seventh column and adds ever other column. I also need to have a formula
that starts in the sixth column and adds every other column thereafter. I'm
confused (still).

Thanks,

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Adding cells in every other column

Thanks Dave,

That makes perfect sense to me know. I assumed each inventory row would
need an indicator row since there would be multiple entries on each row from
various columns used.

The MOD function is a nice little tool; I will be able to use that in
another project that I will be working on soon.

Thanks again!

Mark

"Dave Peterson" wrote:

You wouldn't need hundreds of rows of indicators. You'd just check the single
row in the formula.

Notice the $ signs around $h$1:$iv$1 in this formula:
=sumif($h$1:$iv$1,"$",$h7:$iv7)

That means that this range won't change when you copy the formula to other
locations.

=mod(...,2)
will return 0 or 1
=mod(...,3)
will return 0, 1, or 2
=mod(...,18)
will return whole numbers between 0 and 17.

So you can change this portion:
MOD(COLUMN(g7:IV7),2)=0
to
MOD(COLUMN(g7:IV7),3)=0 (or 1 or 2--depending on what column you want)

MarkT wrote:

Sorry for the confusion, my fault, I changed my spreadsheet around a bit
inbetween postings, I moved some columns around.

I always try to learn something when I get stuck, that's why I appreicate
everyone's response to my various questions.

What would happen if I wanted to count every third column? Is this possible
since with the formula result being true or false? True being even, false
being odd?

As far as the hidden row, I understand your concern, but I have hundres of
rows of inventory items, so I would have to have hundreds of rows of
indicators. It's shouldn't be a problem with adding rows, that side of the
spreasheet is fairly basic and I don't see any changes ever being made.

Whenever I make a change to a spreasheet like that, I usually start over
from scratch and do things differently, more efficiently, etc.

In any event, again, thanks very much for your help I appreicate it very much.

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

The =mod(..., 2) will return a 0 or 1. 1 means you're in an odd numbered
column. 0 means you're in an even numbered column.

But I'm confused about what you want. Column G is column 7. That's an odd
number.

You could add the odd numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=1),g7:IV7)

You could add the even numbered columns starting with G:
=SUMPRODUCT(--(MOD(COLUMN(g7:IV7),2)=0),g7:IV7)

====
I still like the (hidden) row of indicators and =sumif().

MarkT wrote:

Dave, one more quick question. How would I change your formula to do the
same thing, but have it add up columns G,I,k etc, in other words one column
before the h column - as in your formula provided. I tried to change your
formula from H7 to G7 but I get the same result? Your formula starts with
the seventh column and adds ever other column. I also need to have a formula
that starts in the sixth column and adds every other column thereafter. I'm
confused (still).

Thanks,

Mark

"Dave Peterson" wrote:

=SUMPRODUCT(--(MOD(COLUMN(H7:IV7),2)=1),H7:IV7)

You could use the column in which your data ends instead of IV, too.

MarkT wrote:

It comes up with 0 (zero); and a circular reference error.

"JE McGimpsey" wrote:

One way:

=SUMPRODUCT(--(MOD(COLUMN(7:7),2)=1),7:7)


In article ,
MarkT wrote:

Hello,

I am using Excel 2007 with Win XP.

I am trying to create a current inventory count in column B of each row of
items. The count as inventory comes in or goes out will be located on the
same row, in every other column starting in column H. In other words the
count will be in cells H7, J7, L7, N7 and so on. There is no ending column -
no definate place the count will stop. It will be hundreds of columns, so I
don't want to do a formula such as

=sum(H7+J7+L7 .....etc)

I would like this in a formula format so that I can drag the formula down in
the spreadsheet to each row for each item that I am tracking.

Is there a way to sum specific columns other than the formula above?

Thanks again for everyone's help!

Mark


--

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
Adding specific cells in column MG Excel Worksheet Functions 1 February 23rd 06 10:09 PM
adding individual cells in a column Sheila Excel Worksheet Functions 4 January 30th 06 11:36 PM
Adding cells in a column TJ Excel Discussion (Misc queries) 1 January 24th 06 08:42 PM
ADDING SUM TOTAL OF MORE THAN 30 CELLS IN A COLUMN TOGETHER - WON. Robin Excel Discussion (Misc queries) 4 December 21st 04 04:44 AM
ADDING SUM TOTAL OF MORE THAN 30 CELLS IN A COLUMN TOGETHER - WON. Robin Smith Excel Discussion (Misc queries) 0 December 20th 04 08:47 PM


All times are GMT +1. The time now is 02:35 PM.

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

About Us

"It's about Microsoft Excel"