SUM/COUNTIF in excel 2013 - excel

I'm having some issues with a formula. In the formula I'm trying to sum the number of items in column E based upon the condition in column C.The formula I've used is, (which is working correctly.)
=SUM(COUNTIFS('Sheet1'!E:E,C86,'Sheet1'!C:C,{"A","B","C","E1","E2","F","G","X","T"}))
However in the next cell I'm trying go a bit further and trying to count the number of "Yes" and "NA" in column R based upon the condition in column E and Column C. The formula I've used is -
=SUM(COUNTIFS('Sheet1'!E:E,C86,'Sheet1'!C:C,{"A","B","C","E1","E2","F","G","X","T"},'Sheet1'!R:R,{"Yes","NA"}))
This time the formula is counting only "A" in column C and "Yes" in column R. It'll be great help if someone can point what mistake I'm making with this formula.
Thanks in advance!
Best Regards,
gmainak

Change 'Sheet1'!R:R,{"Yes","NA"} to 'Sheet1'!R:R,{"Yes";"NA"}
You can only do two arrays and one needs to be vertical ; and the other horizontal ,:
=SUM(COUNTIFS('Sheet1'!E:E,C86,'Sheet1'!C:C,{"A","B","C","E1","E2","F","G","X","T"},'Sheet1'!R:R,{"Yes";"NA"}))

Related

Sum.ifs for few single cells in a row

Im trying to make sum.ifs formula to sum values in one row based on criteria.
In Criteria for Z I want to sum ALL Zs in table and same for D criteria.
Can I use sort of sum.ifs(A1:C1:E1;B1:D1:F1;G1) function? Unfortunately A1:C1:E1 trys to take range, not single cells and I get error...
What about this: (ugly but working)
=SUM(IF(A3:E3="Z",OFFSET(A3:E3,0,1),0))
It just goes over all cells (even the ones with the values are checked if they equal "Z", but as this is not the case (as they are values), they are skipped).
Edit (better formulated than the first one):
Next proposal:
=SUM(IF($A3:$E3=F$2,OFFSET($A3:$E3,0,1),0))
The dollarsigns are meant for fixing rows and/or columns:
$A3:$E3 : we will always be working with columns A to E, but the rows may change.
F$2 : the criteria are always on row 2, but some are in column F ("Z")
and some in column G ("D").
Place this in G3
=SUMIF(A3:E3,{"=Z","=D"},B3:F3)
The range A3:E3 is checked for the criteria of "=Z" and "=D" in turn, and the range over B3:F3 is then summed.
If you have Office 365 you could use: =SUM(FILTER(B3:F3,COUNTIF(G2:H2,A3:E3)>0))
Not sure if you wanted all summed at once or per letter. To have sum per letter use:
=SUM(FILTER(B3:F3,COUNTIF(G2:H2,A3:E3)>0)) and drag to the right

Excel sum without specific rows

I need help with creating sum formula on Excel sheet.
I need on excel show sum formula without specific rows. In these rows for example is word "W" or something other way. And I need show sum for example:
=SUM(A1:A5) ........ without if column E have = "W"
I tried checkbox solution, but I finding other better solution:
Please can you help me, how can I do it?
EDIT :
i also posting you my excel sheet what i tried from your solution, but not working:
example of excel sheet
You are looking for something like =SUMPRODUCT(--(NOT(E1:E5="W")),A1:A5). Sumproduct multiplies everything in one column with everything in another, and sums the results. -- converts a boolean statement into a 1 or a 0.
So, with this formula, you would be multiplying each item in column A with either a 1 or a 0. Obviously, things multiplied by zero do not have any effect on the final sum :)
You could use SUMIF formula to only sum column A if the column E has a value of W like below:
=SUMIF(E:E,"w",A:A)

"Resetting" Average in Excel

Please pardon my poor explanation of my problem, any insight would be greatly appreciated.
I am using an average in excel that begins at a fixed cell and fills down.
For example: column B contains values, and column C contains the formula =AVERAGE($B$1:B1) filled down, so at row 10 the formula is =AVERAGE($B$1:B10)
I am wondering if there is a way to calculate this average that will "reset" when the value in the column A changes. Getting a formula for whether column A changes is easy using an IF function but I don't know how to change the reference cell when the average "resets." I attempted to attach an image with the formulas but I do not have 10 reputation so here is a link to a short example sheet:
https://drive.google.com/file/d/0BymZUcneHsYgUnRoYkRkdnJYbmM/view?usp=sharing
I would prefer do accomplish this without VBA if possible.
Thank you very much.
EDIT: would it be possible to have a count function next to the data column that starts over when column A switches from "A" to "B" (or "B" to "A"), then I could simply use an average offset with the resulting value to get the desired average?
You should use the =AVERAGEIF function.
=AVERAGEIF($A$1:A1,A1,$B$1:B1)
Here's how I ended up solving this:
I used =ROW()-MAX(INDEX((A$1:A2<>A2)*ROW(A$1:A2),0 to count down until "A" changed to "B" or vice versa, then used =ROW()-MAX(INDEX((A$1:A2<>A2)*ROW(A$1:A2),0 to average the data with the offset calculated in the previous formula.
Note that the data was still in column B, with "A" or "B" in column A, and these two formulas were placed in I and J, respectively
Thank you very much for all your help
You can use Indirect to resolve a custom range. Since values in "A" can come multiple time in distinct block, you will have to add an extra column to keep track of the starting row of each range :
(starting from row 2, [C1] = 1)
=IF(A2<>A1,ROW(A2),C1)
the result will be in column "D" :
=AVERAGE(INDIRECT("B"& C1 &":B"&ROW(A1)))

Excel formula to find val in column and add to another cell

Excel to find a certain value in column C (the number 280) and if it finds that value in column C I want it to add a different value in column J ($ 35.00)
Is there an automated way or a way to do this with a formula?
I have tried sorting by column 2 then adding to column J but I can never get the spreadsheet to go back to the original way it was.
How can this be done?
This is simple (put this in column J) :
=IF(C1=280; "35.00";"")
If it won´t work, you have a different language in excel.

Use RANK function for cell range based on criteria in separate cell range

I have a question regarding the RANK function in MS Excel 2010. I have a large worksheet whose rows I want to rank based on the values in a column. These values can be positive or negative. I found helpful advice here which explains how to rank the values in a column while excluding all values that equal zero from the ranking and the ranking count. They use the following formula:
IF(O24<0, RANK(O24,$O$24:$O$29) - COUNTIF($O$24:$O$29,0), IF(O24=0, "", RANK(O24,$O$24:$O$29)))
This works great, but it would be even better if I could rank the values only if a corresponding value in the same row but a different column meets certain criteria.
Is something like this possible and how would I do it? How would I update the example formula above to make the change work? Thank you very much in advance for your help.
P.S.: I tried putting in a table but it didn't really work, sorry...
You can use COUNTIFS function to rank based on a condition in another column, e.g. this formula in row 24 copied down [edited to include extra IF)
=IF(O24=0,"",IF(N24="x",COUNTIFS(O$24:O$29,">"&O24,O$24:O$29,"<>0",N$24:N$29,"x")+1,""))
That will rank high to low where column N = "x", ignoring zero values
See this example columns N and O contain random values - press F9 to re-generate new random values and formula results in column Q will change accordingly
It is certainly possible to keep creating more complex formulas whenever you're adding new criteria on which to rank. However by creating intermediary columns with single-step formulas, you'll make your spreadsheet easier to comprehend and easier to add new criteria or edit the existing.
My suggestion is to create a column that excludes the zero's (let's assume this is in column P): =IF(O24 = 0, "", O24)
Then in column R, to eliminate negative values (this step is unnecessary, but your original formula does something similar): =IF(P24 = "", "", P24 - MIN(0, MIN($O$24:$O$29)))
Now in column S, add your newest criteria: =IF(OR(R24="", [enter newest criteria here]), "", R24)
Finally, column T performs the ranking of only the selected rows: =IF(S24="", "", RANK(S24, S$24:S$29))
If exposing columns P, R and S is bothersome, you can always hide them.
A rewording of the answer from barry houdini, using table format.
Value_Col is the column with the values to rank. Group_Column is the column with the group by values, to rank within groups
=COUNTIFS([Value_Col], ">"&[#[Value]], [Value_Column],"<>0", [Group_Column], [#[Group]]) +1

Resources