Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JN JN is offline
external usenet poster
 
Posts: 29
Default calculate sum between different criteria

I need to sum a range of numbers based on 2 different criteria. Example:

Col A Col B
101 5
112 10
125 5
130 20

I need to sum Col B if the numbers in Col A are between 110 & 129. The
correct answer would be 15. I've tried IF, AND and nesting them but
nothing is working correctly
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default calculate sum between different criteria

=SUMPRODUCT((A1:A10)=110)*(A1:A10)<=129)*(B1:B10) )

Change ranges to suit but cannot be whole columns i.e A:A is not valid

HTH

"JN" wrote:

I need to sum a range of numbers based on 2 different criteria. Example:

Col A Col B
101 5
112 10
125 5
130 20

I need to sum Col B if the numbers in Col A are between 110 & 129. The
correct answer would be 15. I've tried IF, AND and nesting them but
nothing is working correctly

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 171
Default calculate sum between different criteria

Sumproduct works, but I prefer something that more folks understand: add up
all the values where column A is greater than 110, then subtract from that
the sum of those where column A is greater than or equal to 129. What's left
is the sum of all those in between:
=SUMIF(A:A,"" & 110,B:B) - SUMIF(A:A,"=" & 129,B:B)
(In a nutshell, I use two sumifs to pick out a range on a single variable;
I'd resort to sumproduct to deal with criteria in multiple columns).

"JN" wrote:

I need to sum a range of numbers based on 2 different criteria. Example:

Col A Col B
101 5
112 10
125 5
130 20

I need to sum Col B if the numbers in Col A are between 110 & 129. The
correct answer would be 15. I've tried IF, AND and nesting them but
nothing is working correctly

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default calculate sum between different criteria

=SUMIF(A:A,"=110",B:B) - SUMIF(A:A,"129",B:B)


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"JN" wrote in message
...
I need to sum a range of numbers based on 2 different criteria. Example:

Col A Col B
101 5
112 10
125 5
130 20

I need to sum Col B if the numbers in Col A are between 110 & 129. The
correct answer would be 15. I've tried IF, AND and nesting them but
nothing is working correctly



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JN JN is offline
external usenet poster
 
Posts: 29
Default calculate sum between different criteria

Once again you have saved me! Thanks so much!

"Bob Phillips" wrote:

=SUMIF(A:A,"=110",B:B) - SUMIF(A:A,"129",B:B)


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"JN" wrote in message
...
I need to sum a range of numbers based on 2 different criteria. Example:

Col A Col B
101 5
112 10
125 5
130 20

I need to sum Col B if the numbers in Col A are between 110 & 129. The
correct answer would be 15. I've tried IF, AND and nesting them but
nothing is working correctly






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 to calculate how many meet min and max criteria Tuukka Excel Worksheet Functions 1 January 8th 07 09:10 AM
Calculate mode based on criteria goofy11 Excel Worksheet Functions 1 November 27th 06 09:55 PM
calculate a MEDIAN using multiple criteria? MetricsShiva Excel Worksheet Functions 0 August 19th 05 04:39 PM
calculate the sum based on two different criteria Ken Excel Discussion (Misc queries) 1 May 22nd 05 09:58 AM
calculate percent from multiple criteria Jan Excel Worksheet Functions 0 November 10th 04 06:09 PM


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