Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to combine 2 SUM-IF but Excel says that it is not possible
What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200)
-- Regards, Tom Ogilvy "Frankyboy" wrote in message . .. I need to combine 2 SUM-IF but Excel says that it is not possible What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this formula doesn't work for me. What do you mean by "--" in the formula?
I have tried all of those and nothing works: =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) =sumproduct(sumproduct(A1:A200=X),sumproduct(B1:B2 00=Y),C1:C200) =sumproduct((A1:A200=X),(B1:B200=Y),C1:C200) =sumproduct(A1:A200=X,B1:B200=Y,C1:C200) I don't see where I'm wrong? "Tom Ogilvy" a écrit dans le message de ... =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) -- Regards, Tom Ogilvy "Frankyboy" wrote in message . .. I need to combine 2 SUM-IF but Excel says that it is not possible What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The -- is a cool trick to turn a boolean into a number: TRUE = 1, FALSE = 0
If A1 equals X then --(A1=X) = 1 If A1 doesn't equal X then --(A1=X) = 0 Another way of turning a boolean into a number is: A1*1 (where A1 is TRUE or FALSE) -- Rob van Gelder - http://www.vangelder.co.nz/excel "Frankyboy" wrote in message . .. this formula doesn't work for me. What do you mean by "--" in the formula? I have tried all of those and nothing works: =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) =sumproduct(sumproduct(A1:A200=X),sumproduct(B1:B2 00=Y),C1:C200) =sumproduct((A1:A200=X),(B1:B200=Y),C1:C200) =sumproduct(A1:A200=X,B1:B200=Y,C1:C200) I don't see where I'm wrong? "Tom Ogilvy" a écrit dans le message de ... =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) -- Regards, Tom Ogilvy "Frankyboy" wrote in message . .. I need to combine 2 SUM-IF but Excel says that it is not possible What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
is X a text value (thqats is the character 'X'). If yes, try =sumproduct(--(A1:A200="X"),--(B1:B200="Y"),C1:C200) or =sumproduct((A1:A200="X")*(B1:B200="Y"),C1:C200) Frank Frankyboy wrote: this formula doesn't work for me. What do you mean by "--" in the formula? I have tried all of those and nothing works: =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) =sumproduct(sumproduct(A1:A200=X),sumproduct(B1:B2 00=Y),C1:C200) =sumproduct((A1:A200=X),(B1:B200=Y),C1:C200) =sumproduct(A1:A200=X,B1:B200=Y,C1:C200) I don't see where I'm wrong? "Tom Ogilvy" a écrit dans le message de ... =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) -- Regards, Tom Ogilvy "Frankyboy" wrote in message . .. I need to combine 2 SUM-IF but Excel says that it is not possible What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Replacing X and Y with cell references
=SUMPRODUCT(--(A1:A200=E1),--(B1:B200=F1),C1:C200) works fine Replacing with constants =SUMPRODUCT(--(A1:A200="A"),--(B1:B200=3),C1:C200) works fine. For X and Y to work as the formula was written, they would have to be defined names. I was using the example information you gave. -- Regards, Tom Ogilvy Frankyboy wrote in message . .. this formula doesn't work for me. What do you mean by "--" in the formula? I have tried all of those and nothing works: =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) =sumproduct(sumproduct(A1:A200=X),sumproduct(B1:B2 00=Y),C1:C200) =sumproduct((A1:A200=X),(B1:B200=Y),C1:C200) =sumproduct(A1:A200=X,B1:B200=Y,C1:C200) I don't see where I'm wrong? "Tom Ogilvy" a écrit dans le message de ... =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) -- Regards, Tom Ogilvy "Frankyboy" wrote in message . .. I need to combine 2 SUM-IF but Excel says that it is not possible What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to be completely clear:
If you meant column A literally contains the letter X and column B literally contains the letter Y =sumproduct(--(A1:A200="X"),--(B1:B200="Y"),C1:C200) -- Regards, Tom Ogilvy Tom Ogilvy wrote in message ... =sumproduct(--(A1:A200=X),--(B1:B200=Y),C1:C200) -- Regards, Tom Ogilvy "Frankyboy" wrote in message . .. I need to combine 2 SUM-IF but Excel says that it is not possible What I need to do is to get the sum of column C if the value of column A is X and the value of column B is Y Can someone help me with that? Frank |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Offset function with nested match function not finding host ss. | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
Adding a custom function to the default excel function list | Excel Programming |