![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Uni Credit Union
Posts: 17
|
What I want to do is a 'sumif function' with 2 criteria-
ie if member is class 2 and decile 1. Is there a way of linking these two criteria together in this type of function? [ This Message was edited by: AmberJo on 2002-05-12 22:44 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
You need a SUMPRODUCT, an array, or DSUM formula: =SUMPRODUCT((Range1=E1)*(Range2=E2),Range3) where Range1 and Range2 are ranges for which the criteria/conditions in E1 and E2 (such as class and decile values), repectively, must hold. Range3 is the range to be summed. |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
sorry,
I didnt realise what class and decile was referring to! |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Location: Uni Credit Union
Posts: 17
|
I can't get it to work:
Column F is decile, Column B is class, and column K is total savings (the bit I want summed). I want the total savings of members who are in decile 1 AND class 2. This is what I've got so far : =SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!$F:$F=1)*('[May 2 02 without formulas.xls]Sheet1'!$B:$B=2), ('[May 2 02 without formulas.xls]Sheet1'!K:K) Am I on the right track? |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
|
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Apr 2002
Location: Uni Credit Union
Posts: 17
|
XL still doesn't like it. It suggests I put a * instead of a comma before the last bit (ie =SUMPRODUCT('[May 2 02 without formulas.xls]Sheet1'!F1:F13000=1)*('[May 2 02 without formulas.xls]Sheet1'!B1:B13000=2)*('[May 2 02 without formulas.xls]Sheet1'!K1:K13000)
When I do this it comes up with an #N/A thingy. Any ideas? |
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
should be Ok. BTW: a "*" as well as a "," will both work between the last 2 arguments. [ This Message was edited by: Aladin Akyurek on 2002-05-12 19:30 ] [ This Message was edited by: Aladin Akyurek on 2002-05-12 19:32 ] |
|
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
The problem might be with syntax (the organization of the formula), and not with the logic of the formula that Aladin gave you. Look at you formula carefully, and see if you have supplied everything correctly as Aladin suggested. You may also post the actual formula that is giving you the #N/A -- please also post the values of the cells in your formula. Regards!
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
|
#9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
See the figure, in which I also added the use of DSUM. Since you have a big range, the latter might suit you better.
To see the formula in the cells just click on the cells hyperlink The above image was automatically generated by [HtmlMaker V1.20] If you want this code, click here and Colo will email the file to you. This code was graciously allowed to be modified: by Ivan F Moala All credit to Colo [ This Message was edited by: Aladin Akyurek on 2002-05-12 19:59 ] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|