Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Adding cells that meet certain criteria

I have a row of 24 numbers, A1:X1. I would like Y1 to SUM only those cells
if they have negative numbers in them and Z1 to SUM only those cells that
have positive numbers. Thanks!
--
Patti
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Adding cells that meet certain criteria

In Y1 =SUMPRODUCT((A1:X1)*(A1:X1<0))
In Z1 =SUMPRODUCT((A1:X1)*(A1:X10))
--
HTH...

Jim Thomlinson


"PattiP" wrote:

I have a row of 24 numbers, A1:X1. I would like Y1 to SUM only those cells
if they have negative numbers in them and Z1 to SUM only those cells that
have positive numbers. Thanks!
--
Patti

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Adding cells that meet certain criteria

P.S. sorry, I got the "positive/negative" mixed up, but I think you can
figure it out.

"PattiP" wrote:

I have a row of 24 numbers, A1:X1. I would like Y1 to SUM only those cells
if they have negative numbers in them and Z1 to SUM only those cells that
have positive numbers. Thanks!
--
Patti

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Adding cells that meet certain criteria

Very interesting! I'm sold.

P.S. in all fairness to SUM(IF(... the IF() syntax (A1:An="?")*(B1:Bn="?")
works the same as in SUMPRODUCT, without having to use multiple IF()
statements as shown at that web site. But SUMPRODUCT seems to be a
"packaged" SUM(IF( function, much nicer and no Ctrl+Shift+Enter.

"Jim Thomlinson" wrote:

If you are interested here is a link to a site that gives a lot of great info
on the sumproduct formula...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

This is a very useful reference that I highly recommend.
--
HTH...

Jim Thomlinson


"PattiP" wrote:

Thanks to you both !!!!
--
Patti


"Charlie" wrote:

in Y1
=SUM(IF(A1:X10,A1:X1))
in Z1
=SUM(IF(A1:X1<0,A1:X1))

NOTE: after entering the formulas you must hold down both the Shift and Ctrl
keys at the same time, then press Enter (Ctrl+Shift+Enter). You will see the
formula in curly braces if you do it correctly. This gives you an "array
formula" to calclulate on the whole range.

{=SUM(IF(A1:X10,A1:X1))}

"PattiP" wrote:

I have a row of 24 numbers, A1:X1. I would like Y1 to SUM only those cells
if they have negative numbers in them and Z1 to SUM only those cells that
have positive numbers. Thanks!
--
Patti

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Adding cells that meet certain criteria

If you are interested here is a link to a site that gives a lot of great info
on the sumproduct formula...

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

This is a very useful reference that I highly recommend.
--
HTH...

Jim Thomlinson


"PattiP" wrote:

Thanks to you both !!!!
--
Patti


"Charlie" wrote:

in Y1
=SUM(IF(A1:X10,A1:X1))
in Z1
=SUM(IF(A1:X1<0,A1:X1))

NOTE: after entering the formulas you must hold down both the Shift and Ctrl
keys at the same time, then press Enter (Ctrl+Shift+Enter). You will see the
formula in curly braces if you do it correctly. This gives you an "array
formula" to calclulate on the whole range.

{=SUM(IF(A1:X10,A1:X1))}

"PattiP" wrote:

I have a row of 24 numbers, A1:X1. I would like Y1 to SUM only those cells
if they have negative numbers in them and Z1 to SUM only those cells that
have positive numbers. Thanks!
--
Patti

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
countif two corresponding cells meet the criteria chris Excel Worksheet Functions 3 November 4th 08 05:21 PM
Count Cells that meet Criteria kmason Excel Worksheet Functions 6 August 24th 06 04:31 PM
Sum Total # Of Cells That Meet Several Criteria ashstudly Excel Worksheet Functions 4 January 23rd 06 05:55 AM
Adding cells that meet certain criteria Charlie Excel Programming 1 December 14th 05 05:40 PM
Adding the sum of figures in one column if they meet 2 criteria Justine Burn via OfficeKB.com Excel Worksheet Functions 4 February 22nd 05 02:36 AM


All times are GMT +1. The time now is 05:05 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"