Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Creating a formula for two columns with Criteria

A B
1 10 20
2 10 0
3 10 -5
4 10 15
5 10 0

Alright say you have this as your data field. I know that using the SUMIF
function will give me the total of A if B 0 (or whatever I set the criteria
to), BUT how can I get the sum of A AND B if B is greater than 0
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Creating a formula for two columns with Criteria

I'd use something like:
=SUMIF(B:B,""&0,A:A)+SUMIF(B:B,""&0)
or
=SUMIF(B:B,""&0,A:A)+SUMIF(B:B,""&0,B:B)



smorrison wrote:

A B
1 10 20
2 10 0
3 10 -5
4 10 15
5 10 0

Alright say you have this as your data field. I know that using the SUMIF
function will give me the total of A if B 0 (or whatever I set the criteria
to), BUT how can I get the sum of A AND B if B is greater than 0


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Creating a formula for two columns with Criteria

Try this:

=SUMPRODUCT((B1:B50)*((B1:B5)+(A1:A5)))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"smorrison" wrote in message
...
A B
1 10 20
2 10 0
3 10 -5
4 10 15
5 10 0

Alright say you have this as your data field. I know that using the SUMIF
function will give me the total of A if B 0 (or whatever I set the

criteria
to), BUT how can I get the sum of A AND B if B is greater than 0


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Creating a formula for two columns with Criteria

Slightly shorter, and more elegant

=SUMPRODUCT((B1:B50)*A1:B5)


"Ragdyer" wrote:

Try this:

=SUMPRODUCT((B1:B50)*((B1:B5)+(A1:A5)))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"smorrison" wrote in message
...
A B
1 10 20
2 10 0
3 10 -5
4 10 15
5 10 0

Alright say you have this as your data field. I know that using the SUMIF
function will give me the total of A if B 0 (or whatever I set the

criteria
to), BUT how can I get the sum of A AND B if B is greater than 0



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Creating a formula for two columns with Criteria

Yes ... more elegant!<bg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Teethless mama" wrote in message
...
Slightly shorter, and more elegant

=SUMPRODUCT((B1:B50)*A1:B5)


"Ragdyer" wrote:

Try this:

=SUMPRODUCT((B1:B50)*((B1:B5)+(A1:A5)))

--
HTH,

RD


--------------------------------------------------------------------------

-
Please keep all correspondence within the NewsGroup, so all may benefit

!

--------------------------------------------------------------------------

-
"smorrison" wrote in message
...
A B
1 10 20
2 10 0
3 10 -5
4 10 15
5 10 0

Alright say you have this as your data field. I know that using the

SUMIF
function will give me the total of A if B 0 (or whatever I set the

criteria
to), BUT how can I get the sum of A AND B if B is greater than 0




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 can I have a formula result based on multiple criteria/columns nicky_p New Users to Excel 1 July 5th 06 01:45 PM
Creating shapes from given criteria Michael M Excel Worksheet Functions 0 April 26th 06 03:32 AM
Need formula that Counts items matching criteria using two columns Juana Cafe Excel Worksheet Functions 4 March 3rd 06 08:41 PM
formula to count occurence of criteria in 2 columns needs help Excel Worksheet Functions 2 July 27th 05 09:17 PM
Pivot Table Creating New Columns that Subtract Two Existing Columns den4673 Excel Discussion (Misc queries) 3 December 17th 04 01:31 PM


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