Im trying to use sumproduct with multiple criteria 1 in the first column and 2 critera in the second column, lets say apples and pears, I've tried using the '+' or syntax which seems a bit hit and miss or maybe im just not using it correctly. Can I add 2 function together sort of sumproduct(--(dddd=aaa),--(adkjdkf)+sumproduct(--(akdd),--(aldkfk))
Richard
You are close on the second guess. Try using conditional logic within the SUMPRODUCT.
Something like =SUMPRODUCT(--(ColumnA=criteria), --(ColumnB=criteria), range1, range2)
Related
I have been trying to figure it out for what I was doing wrong
Here the explanation for what I am currently doing :
It is a game that customer need to guess for 4 condition (outfit,brand,color,price)
I have to match between 2 worksheets which is customer's guessing and list (which is criteria)
it going to show only 2 result (bingo,try again like in yellow column)
the criteria is guessing for outfit,brand,color need to be exactly correct (as shown in list-worksheet)
for price it can be the other values but not less/more than 5
=IF(ABS(INDEX(list!D:D,MATCH(A2,list!A:A,0),MATCH(B2,list!B:B,0),MATCH(C2,list!C:C,0))-D2)<=5,"bingo",IF(ABS(INDEX(list!F:F,MATCH(A2,list!A:A,0),MATCH(B2,list!B:B,0),MATCH(C2,list!E:E,0))-D2)<=5,"bingo","try again"))
the above is formula that I use but it turned out error
if doing correctly the result would be like in yellow column
Note column and orange highlights does not involve it's just optional explanation for your understanding
list
So the main reason you're running into issues is because your list worksheet is setup terribly. Excel runs best with a flat-file type data structure. It should be reformatted to this:
Then you can setup your guessing game and use a simple SUMIFS formula:
In cell E2 of the guessing game worksheet, the formula is:
=IF(ABS(D2-SUMIFS(list!D:D,list!A:A,A2,list!B:B,B2,list!C:C,C2))<5,"Bingo!","Try again")
I am trying to combine COUNTIF and VLOOKUP function so that I can use it to formulate my work and increase my efficiency.for better understanding suppose a column A has 4 people name like 1.jay 2.harry 3.ray . So i have assign them randomly "0" and "1" . SO ray might get multiple "0" and "1" and these can happen with everyone. So I want to know how may "0" and "1" each one get.
I have tried everything I know but its giving me wrong data
=COUNTIF(VLOOKUP(A2,A:B,2,0),"0")
after using the above code its giving me wrong output .
use COUNTIFS()
=COUNTIFS(A:A,$D2,B:B,E$1)
Method 1
Using the following SUMPRODUCT formula suppose you have named values in Column A as NameList and named values in Column B as Value:
=SUMPRODUCT((NameList=$D2)*(Value=E$1))
If you want to use formula, I would recommend the COUNTIFS function suggested by Scott Craner as it is faster than SUMPRODUCT in a large scale.
Method 2
You can quickly insert a pivot table and set up as shown above to get the count per value per name with a few clicks. Pro is that you do not even need to find the names from the list first, Con is that it is not that flexible to do further calculations from the values within a pivot table.
I need to sum the values of several columns, if other cells in the same row match a predefined criteria. The working formula for only 3 columns is the following:
=SUM(SUMIFS(‘Sheet1'!W:W; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!X:X; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!Y:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4"))
I will need to use the formula for several cells (and sum more than 10 columns per time) and I will need to change the columns manually, so I need the same formula in the following way:
=SUMIFS(‘Sheet1'!W:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4")
,but currently this formula leads to a "#VALUE!" error. The reason for that is (I assume) the use of multiple columns "W:Y"
Can you suggest a workaround?
I would suggest to use SUMPRODUCT rather than SUMIFS. You can build something like that :
=SUMPRODUCT((B1:B1048575="Sales")*(C1:C1048575>=4)*(W1:Y1048575))
The downside of SUMPRODUCT is that you can't use a whole column (for example you cannot write SUMPRODUCT((B:B="Sales"...)), this would generate an error).
Hope this helps.
I suggest you add a column with the sum('sheet1'!W:Y) and then use sumifs on this columns. It is a two step way but it will give the result you expect
Here's what I have :)
=SUM(SUMIFS('WTD Raw'!R:R,'WTD Raw'!E:E,"Kindle-Customer Care",'WTD
Raw'!J:J,"Week27",'WTD Raw'!H:H,'PassRate | July'!G8) + SUMIFS('WTD
Raw'!R:R,'WTD
Raw'!E:E,"Kindle-Technical Support",'WTD Raw'!J:J,"Week27",'WTD
Raw'!H:H,'PassRate | July'!G8))
Instead of using ";" use the Mathematical Operators for it to work.
I'm using Excel 2010 and have a datasheet with multiple tabs, this is the current SUMIF function that I am using
=IF(SUMIF('Master Data'!$J$2:$J$200,'Resource View (2)'!B22,'Master Data'!$W$2:$W$200)>0,Current_row_different column, "")
Basically, I find some rows in the other sheet that have a value of 1 I then want to use these rows that have a value of 1 but use a different column within that row to populate the true condition.
So say for instance row 4 contains a 1 at column A I then want to stay on row 4 but get the value of column B for the true condition.
Is this possible?
EDIT:
I have now managed to get the function working however its a bit of an Excel hack, because I have had to move the columns around in the master data and its a bit messy now anyway here's what I've got
=IF(SUMIF('Master Data'!$C$2:$C$200,'Resource View (2)'!B22,'Master Data'!$W$2:$W$200)>0,VLOOKUP(B22,'Master Data'!$C$2:$F$90,3,FALSE),"")
Now I know this is because VLOOKUP searches through the first column specified and it doesn't seem to work at all if i try to put the range in backwards i.e. $F$90:$C$2 instead of $C$2:$F$90. Is there any way to manipulate VLOOKUP to work like this?
Yes, actually there is a way - a brother of VLOOKUP - it's INDEX(MATCH()). It is a very useful tool, as you can look at any column and return any other, not only looking at the first one to return the ones to the right. Also, INDEX(MATCH()) can be used in forming array formulas, if you need that, while VLOOKUP cannot.
Basically, this part of your formula:
VLOOKUP(B22,'Master Data'!$C$2:$F$90,3,FALSE)
would be changed with this:
INDEX('Master Data'!$E$2:$E$90,MATCH(B22,'Master Data'!$C$2:$C$90,FALSE))
So, after all, the equivalent for
=IF(SUMIF('Master Data'!$C$2:$C$200,'Resource View (2)'!B22,'Master Data'!$W$2:$W$200)>0,VLOOKUP(B22,'Master Data'!$C$2:$F$90,3,FALSE),"")
would be
=IF(SUMIF('Master Data'!$C$2:$C$200,'Resource View (2)'!B22,'Master Data'!$W$2:$W$200)>0,INDEX('Master Data'!$E$2:$E$90,MATCH(B22,'Master Data'!$C$2:$C$90,FALSE)),"")
I have 7 columns that have a yes or no in them (N2-T2). I need an equation that will place a 1 in "AI2" if there is a yes in any of the N-T cells. In my previous work with Excel I have only used the colon in an equation if I am adding the cells. Is this correct or does it have more use?
I tried the equation below and I get an error; #Value!
=IF(N2:T2="yes",0,1)
I also tried this one, however Excel just kept telling me that it wrong. I just tried the first two columns in this example to see if I could make it work.
=IF(N2="yes",IF(O2="yes"),0,1)
The formula you are looking for is
=IF(ISNA(MATCH("yes",N2:T2,0)),0,1)
you can use the logical OR function
=IF(OR(A1="YES";B1="YES";C1="YES";D1="YES";E1="YES";F1="YES";G1="YES");1;0)
This way you are more flexible on what you want to test (4th column "yes" OR 5th column "foo", etc.)
Likewise there is an AND(logical; logical; ...) function as well. Try to avoid cascaded IF's - they are hard to read and debug.