I have a two columns, one with prices and one with the word "yes" or blank.
With this I also have a simple sum for my total cost. I am looking to create an expression that IF the value in column C is yes (or inversely if it is blank), to subtract its corresponding price in column B from the total to come up with the amount left over still.
Thanks for the help.
Assuming that you want to sum the blanks and then minus the "yes"s from that:
=SUMIFS($B:$B, $C:$C, "")-SUMIFS($B:$B, $C:$C, "yes")
Related
Using only "vlookup" does not work because there are a bunch of malfunctioning minutes & total numbers of it. So as I know I should combine "vlookup" with "sum" or I am wrong? please support me on this query.
You can use Countif() to count with conditions and Sumif() to sum up numbers that fulfill a condition.
In cell K10 (count System No malfunctions)
=Countif(A:A,K9)
... in words: count the rows in column A whose text is equal to that in cell K9.
In K11 you can conditionally sum with this formula:
=Sumif(A:A,K9,C:C)
... in words: for all the rows in column A whose text is equal to that in cell K9, sum the values in column C.
Copy the two formulas from K10 and K11, paste them into K15 and K16 and change the reference from A:A to D:D to look at the code column instead of the system number.
As I stated in the title, I want to calculate the sum of the first n% rows in a filtered column. The total numbers of rows in the column varies due to the filtering options, so my formula must work with different values of n.
For example :
In column A, I have 10 rows that contain values from 10 to 1 ( I sorted them from largest to smallest ).
In column B, I have 10 corresponding rows that contain 2 names: 4 of them contain the value "Tom", six of them contain the value "Jerry". When I filter the whole table and select only the rows that contain the value "Jerry", I want to be able to calculate the sum of the first 20% of the corresponding 6 number values.
This could work without any filtering if you want.
With criteria for column B in E1 and percentage you looking for in F1 with the assumption we want to round up the percentage to integers.
So formula in D1:
=SUMPRODUCT(LARGE((B2:B11=E1)*(A2:A11),ROW(A1:INDEX($A:$A,ROUNDUP(COUNTIF(B2:B11,E1)*F1,0)))))
So, without your data, I came up with this, edit to suit your situation...
So, based on the comment, I did a second version:
The helper column in col C is used with sumproduct to give the result...
You can use the percentile function in AGGREGATE with SUMIFS to do what you want:
=SUMIFS(A:A,B:B,"Jerry",A:A,">="&AGGREGATE(16,7,A1:A10/(B1:B10="Jerry"),0.8))
If you want to use the filter to do the decision:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(A1,ROW(A2:A10)-1,,1))*(A2:A10>=AGGREGATE(16,7,A2:A10,0.8)),A2:A10)
I couldn't find a matching answer already but happy to be redirected!
My issue is with countifs across two worksheets but I can replicate it in a smaller environment.
I have three columns of data (A-C): -
Column D has the formula =IF(A2="Closed",C2-B2,0).
That bit works, I now need to count how many took X number of days to close: -
Column G has the formula =COUNTIFS(A2:A11,"Closed",D2:D11,F2)
Looking at the pictures 41 and 49 should have a count of 1 right? What have I done wrong? All cells are formated as numbers.
Your formula in column G uses an absolute comparison to the value in column F.
The problem is that none of your values exactly match that value.
The duration column is formatted to show a value rounded to a day, but the underlying value is not the same as what is showing in the formatted cell.
Therefore, the formula in column G needs to factor in a range of values like this:
=COUNTIFS($A$2:$A$11,"Closed",$D$2:$D$11,">="&F2,$D$2:$D$11,"<"&F3)
In words: count all the cells where column A shows "Closed" and where the value in column D is between the value in F2 and the value in F3.
You will need to add an extra value in column F for anything above your biggest number in column F.
Check you output in Column D. It must be having decimals. If that is the case, you need to round the formulas in column D using ROUND formula.
=ROUND(IF(A2="Closed",C2-B2,0),0)
Rows 4 and 7 have status as "Open" and hence won't be counted by Countifs, i. e. change value of cells A4 and A7 to "Closed" to see updated results.
Also, fix your range $A$2:$A$11, etc. when using Countifs
I can't work this one out. Pretty much as the title says...
How can I get the average of a range or column, if there is a "No" in two other ranges/columns?
To put it another way, I want to calculate an average for column A, and I have two columns which ask a Yes/No question (column B & C). I only want the rows with No/No in B AND C to be included in the average calculation for column A. If B OR C have a yes answer, then I want to EXCLUDE that row from the average calculation for A.
Any idea's? Many thanks in advance!
You can use the AVERAGEIFS() formula to achieve what you want.
Description
Returns the average (arithmetic mean) of all cells that meet multiple
criteria.
Syntax
AVERAGEIFS(average_range, criteria_range1, criteria1,
[criteria_range2, criteria2], ...)
So, assuming that
A1:A8 = numbers range
B1:B8 = condition1 range
C1:C8 = condition2 range
"No" = condition1 and condition2
Formula:
=AVERAGEIFS(A1:A8;B1:B8;"No";C1:C8;"No")
You need the AVERAGEIFS formula that will take a column of values and multiple conditions on whether to include the value of a particular row in the calculation.
See the screenshot:
I am a little rusty to say the least and in Excel I would like to create a formula that counts the number of cases that have been closed without a certain stage taking place.
So, the formula would need to count the number of rows where there is a date in column k, but no date in column n (the cell is blank). Any help would be appreciated. I have had a go with COUNTIFS and SUMPRODUCT but I'm not getting anywhere.
Try this
=COUNTIFS(K:K,">0",N:N,"")
that's counting rows where K is greater than zero but N is blank [""]
If you can use another column try this formula, for every row of the column:
=IF(K1>0,1,0)*IF(N1="";1;0)
then you have to sum column values.
Instead of K1>0 you can use two cell for date so you can count cells within a range of date.
For a start try something like:
=SUMPRODUCT((K1:K100<>"")*(N1:N100=""))