ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Selective addition based on criteria (https://www.excelbanter.com/excel-discussion-misc-queries/127306-selective-addition-based-criteria.html)

Randy L

Selective addition based on criteria
 
I have a column of information that contains various numerical entries.

I want to sum the entries to get a total. The entries are both positive and
negative numbers.

If an entry contains the value -250, I want to sum only the negative values
(including the -250 and any other possible -250 entries) omitting any
positive entries. Otherwise it will sum both negative and positive values.

Thank you for your assistance! :)

galimi

Selective addition based on criteria
 
Randy,

I have provided an example at http://www.HelpExcel.com/examples

The name of the spreadsheet is sum.xls
--
http://HelpExcel.com




"Randy L" wrote:

I have a column of information that contains various numerical entries.

I want to sum the entries to get a total. The entries are both positive and
negative numbers.

If an entry contains the value -250, I want to sum only the negative values
(including the -250 and any other possible -250 entries) omitting any
positive entries. Otherwise it will sum both negative and positive values.

Thank you for your assistance! :)


galimi

Selective addition based on criteria
 
Larry,

To get it into one formula, you can type the following:

=IF(SUM(IF(A1:A4=-250,1,0))0,SUM(IF(A1:A4<0,A1:A4,0)),SUM(A1:A4))

Make the scope of the ranges appropriate and be sure to press
control-shift-enter to let Excel know it is a formulaic array
--
http://HelpExcel.com




"Randy L" wrote:

I have a column of information that contains various numerical entries.

I want to sum the entries to get a total. The entries are both positive and
negative numbers.

If an entry contains the value -250, I want to sum only the negative values
(including the -250 and any other possible -250 entries) omitting any
positive entries. Otherwise it will sum both negative and positive values.

Thank you for your assistance! :)


Randy L

Selective addition based on criteria
 
Thank you Galimi. This works great :)

"galimi" wrote:

Larry,

To get it into one formula, you can type the following:

=IF(SUM(IF(A1:A4=-250,1,0))0,SUM(IF(A1:A4<0,A1:A4,0)),SUM(A1:A4))

Make the scope of the ranges appropriate and be sure to press
control-shift-enter to let Excel know it is a formulaic array
--
http://HelpExcel.com




"Randy L" wrote:

I have a column of information that contains various numerical entries.

I want to sum the entries to get a total. The entries are both positive and
negative numbers.

If an entry contains the value -250, I want to sum only the negative values
(including the -250 and any other possible -250 entries) omitting any
positive entries. Otherwise it will sum both negative and positive values.

Thank you for your assistance! :)



All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com