PC Review


Reply
Thread Tools Rate Thread

Add values in a column according to value in another column

 
 
Paul Kaye
Guest
Posts: n/a
 
      10th Jul 2008
How can I add the values in a column according to values in another
column? If there is any value in a row in column B, I want to include
the value of the corresponding row in column A. I'm flexible as to
whether this is ANY value (i.e. not empty) or greater than zero.
 
Reply With Quote
 
 
 
 
Cimjet
Guest
Posts: n/a
 
      10th Jul 2008
Hi Paul
Maybe something like this =IF(B1="","",IF(B1>0,B1+A1))
Regards
Cimjet
"Paul Kaye" <(E-Mail Removed)> wrote in message
news:05befaf3-9ba8-48c8-aebb-(E-Mail Removed)...
> How can I add the values in a column according to values in another
> column? If there is any value in a row in column B, I want to include
> the value of the corresponding row in column A. I'm flexible as to
> whether this is ANY value (i.e. not empty) or greater than zero.


 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      10th Jul 2008
=SUMPRODUCT(A1:A100,--(B1:B100<>"")) adjust the range to suit.
--
Gary''s Student - gsnu2007j


"Paul Kaye" wrote:

> How can I add the values in a column according to values in another
> column? If there is any value in a row in column B, I want to include
> the value of the corresponding row in column A. I'm flexible as to
> whether this is ANY value (i.e. not empty) or greater than zero.
>

 
Reply With Quote
 
Paul Kaye
Guest
Posts: n/a
 
      10th Jul 2008
On Jul 10, 3:04*pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> =SUMPRODUCT(A1:A100,--(B1:B100<>"")) adjust the range to suit.
> --
> Gary''s Student - gsnu2007j
>
> "Paul Kaye" wrote:
> > How can I add the values in a column according to values in another
> > column? If there is any value in a row in column B, I want to include
> > the value of the corresponding row in column A. I'm flexible as to
> > whether this is ANY value (i.e. not empty) or greater than zero.


What does the -- and <> do? I really don't understand that formula!
 
Reply With Quote
 
Paul Kaye
Guest
Posts: n/a
 
      10th Jul 2008
On Jul 10, 2:49*pm, "Cimjet" <cimjet(remove)3...@sympatico.ca> wrote:
> Hi Paul
> Maybe something like this =IF(B1="","",IF(B1>0,B1+A1))
> Regards
> Cimjet"Paul Kaye" <paulmjk...@gmail.com> wrote in message
>
> news:05befaf3-9ba8-48c8-aebb-(E-Mail Removed)...
>
> > How can I add the values in a column according to values in another
> > column? If there is any value in a row in column B, I want to include
> > the value of the corresponding row in column A. I'm flexible as to
> > whether this is ANY value (i.e. not empty) or greater than zero.


The trouble is that it needs to refer to all the rows in a range.
 
Reply With Quote
 
Paul Kaye
Guest
Posts: n/a
 
      10th Jul 2008
On Jul 10, 5:41*pm, Paul Kaye <paulmjk...@gmail.com> wrote:
> On Jul 10, 3:04*pm, Gary''s Student
>
> <GarysStud...@discussions.microsoft.com> wrote:
> > =SUMPRODUCT(A1:A100,--(B1:B100<>"")) adjust the range to suit.
> > --
> > Gary''s Student - gsnu2007j

>
> > "Paul Kaye" wrote:
> > > How can I add the values in a column according to values in another
> > > column? If there is any value in a row in column B, I want to include
> > > the value of the corresponding row in column A. I'm flexible as to
> > > whether this is ANY value (i.e. not empty) or greater than zero.

>
> What does the -- and <> do? I really don't understand that formula!


Sorry Gary's Student - I forgot to say that it worked perfectly, I
just can't understand why!!! Could you give me a brief description?
 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      10th Jul 2008
It just means "not equal to"
--
Gary''s Student - gsnu2007j


"Paul Kaye" wrote:

> On Jul 10, 5:41 pm, Paul Kaye <paulmjk...@gmail.com> wrote:
> > On Jul 10, 3:04 pm, Gary''s Student
> >
> > <GarysStud...@discussions.microsoft.com> wrote:
> > > =SUMPRODUCT(A1:A100,--(B1:B100<>"")) adjust the range to suit.
> > > --
> > > Gary''s Student - gsnu2007j

> >
> > > "Paul Kaye" wrote:
> > > > How can I add the values in a column according to values in another
> > > > column? If there is any value in a row in column B, I want to include
> > > > the value of the corresponding row in column A. I'm flexible as to
> > > > whether this is ANY value (i.e. not empty) or greater than zero.

> >
> > What does the -- and <> do? I really don't understand that formula!

>
> Sorry Gary's Student - I forgot to say that it worked perfectly, I
> just can't understand why!!! Could you give me a brief description?
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      10th Jul 2008
=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html



Paul Kaye wrote:
>
> On Jul 10, 3:04 pm, Gary''s Student
> <GarysStud...@discussions.microsoft.com> wrote:
> > =SUMPRODUCT(A1:A100,--(B1:B100<>"")) adjust the range to suit.
> > --
> > Gary''s Student - gsnu2007j
> >
> > "Paul Kaye" wrote:
> > > How can I add the values in a column according to values in another
> > > column? If there is any value in a row in column B, I want to include
> > > the value of the corresponding row in column A. I'm flexible as to
> > > whether this is ANY value (i.e. not empty) or greater than zero.

>
> What does the -- and <> do? I really don't understand that formula!


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy one column values to another column based on conditionthat row2 contain todays date sanju Microsoft Excel Programming 4 16th Apr 2010 02:26 AM
Autosum column values, if separate column values equal certain val Hulqscout Microsoft Excel Worksheet Functions 1 5th Nov 2008 06:37 PM
Search for a value in column A and return the vaule/values in column B to column C minismood Microsoft Excel Discussion 3 10th Jan 2006 10:02 AM
Summing visible column values but not hidden column values =?Utf-8?B?Qlc=?= Microsoft Excel Misc 2 2nd Nov 2004 06:32 PM
Calculating values to column D with formula based on values column A spolk Microsoft Excel Programming 1 30th Apr 2004 06:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:42 AM.