Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have the following example
A 1 aaa 1 2 aaa 2 3 bbb 3 X 4 ccc 4 5 ccc 5 6 3 7 3 8 9 Cell A1 contains "aaa" Cell B1 contains "1" Cell D3 contains "X" Formula in B6 is =SUMIF(A1:A5,"A",B1:B5) and returns 3 Formula in B7 is =SUMIF(A1:A5,"B",B1:B5) and returns 3 Formula in B8 is =SUMIF(A1:A5,"C",B1:B5) and returns 9 I want to be able to add a function that will allow me to control the formula by whether there is an X on the same row a cople of columns over. So if I put an X on the same line a couple of columns over the formual will do nothing. Is there a way to do this? Thank you. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Perhaps you've got "*A*" in your first formula. You could put this in
B6: =SUMPRODUCT(--(isnumber(SEARCH("a",A$1:A$5)),--(D$1:D$5<"X"),B$1:B$5) Copy this into B7:B8 and change the "a" to "b" and "c" respectively. Hope this helps. Pete On Jan 12, 12:58*am, Joe wrote: I have the following example * * * * A 1 * * aaa * * * 1 * * * * * * * 2 * * aaa * * * 2 * * * * * * * 3 * * bbb * * * 3 * * * * * * * X 4 * * ccc * * * 4 * * * * * * * 5 * * ccc * * * 5 * * * * * * * 6 * * * 3 * * * * * * * 7 * * * 3 * * * * * * * 8 * * * 9 * * * Cell A1 contains "aaa" Cell B1 contains "1" Cell D3 contains "X" Formula in B6 is =SUMIF(A1:A5,"A",B1:B5) and returns 3 Formula in B7 is =SUMIF(A1:A5,"B",B1:B5) and returns 3 Formula in B8 is =SUMIF(A1:A5,"C",B1:B5) and returns 9 I want to be able to add a function that will allow me to control the formula by whether there is an X on the same row a cople of columns over. So if I put an X on the same line a couple of columns over the formual will do nothing. Is there a way to do this? Thank you. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Pete-
I can't past the formula you provided for some reason. It says the formula contains an error. -Joe "Pete_UK" wrote: Perhaps you've got "*A*" in your first formula. You could put this in B6: =SUMPRODUCT(--(isnumber(SEARCH("a",A$1:A$5)),--(D$1:D$5<"X"),B$1:B$5) Copy this into B7:B8 and change the "a" to "b" and "c" respectively. Hope this helps. Pete On Jan 12, 12:58 am, Joe wrote: I have the following example A 1 aaa 1 2 aaa 2 3 bbb 3 X 4 ccc 4 5 ccc 5 6 3 7 3 8 9 Cell A1 contains "aaa" Cell B1 contains "1" Cell D3 contains "X" Formula in B6 is =SUMIF(A1:A5,"A",B1:B5) and returns 3 Formula in B7 is =SUMIF(A1:A5,"B",B1:B5) and returns 3 Formula in B8 is =SUMIF(A1:A5,"C",B1:B5) and returns 9 I want to be able to add a function that will allow me to control the formula by whether there is an X on the same row a cople of columns over. So if I put an X on the same line a couple of columns over the formual will do nothing. Is there a way to do this? Thank you. . |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Using SUMIFS instead of just SUMIF you can specify multiple criteria, so set
your first criteria as you have, then set the second to check for the presence of that X or not. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
That worked great. Thanks Kim!
"Kim Glensor" wrote: Using SUMIFS instead of just SUMIF you can specify multiple criteria, so set your first criteria as you have, then set the second to check for the presence of that X or not. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FInd common data in one column then add number in adjacent column | Excel Worksheet Functions | |||
I can't select non adjacent cells using the control button | New Users to Excel | |||
When data match, copy adjacent value to adjacent column | Excel Worksheet Functions | |||
summing values from adjacent column with refrence from adjacent column | Excel Discussion (Misc queries) | |||
To copy values in a column relevant to text in an adjacent column? | Excel Worksheet Functions |