I'm new to Excel. I'm looking for formula to perform the following.
Column B has values like TM, LA, Break etc. And Average Handling Time (AHT) will be captured in Column E. Now I need Average AHT for the values in Column B. Ex: If Column B has 6 "TM", then their respective time in Column E should be Averaged. This Avg value will be in Cell G4. Similarly I need Avg AHT time for other values in Column B. Can someone help me in this..
Please Refer to the attached Image above
AVERAGEIF
Use the AVERAGEIF function.
Place the following formula in G4 and copy to the right:
=AVERAGEIF($B$4:$B$15,RIGHT(G$3,2),$E$4:$E$15)
Format G4 and H4 to the desired time format or you will see a decimal number.
Proof of Concept
Explanation:
The AVERAGEIF function has three arguments
=AVERAGEIF(A, B, C)
A: Range of cells that has you criteria in it
B: What your criteria is
C: Range of cells to take the corresponding average of
In this case A is $B$4:$B$15. The cell addresses have been lock with the $ to prevent them from changing when the formula is copied.
For B we used the RIGHT(G$3,2) formula. This pulled the last two characters from your header above. Only rows in B that match the last two characters of the headers will be used for the average calculation. Alternatively, this could have been hard coded as "TM" or "LA"
For C, the times in the range $E$4:$E$15 were supplied. The values that match were added together and then that sum was divided by the number of matches to get the average.
Related
I have this file with 3 different sheets.
The first contains the raw data, the second (stats) a first step of analysis and the last (WEEKLY) shows my final extrapolation.
In the WEEKLY sheet, B14 and B15, I want to count the rows from the raw data sheet that, in column G, have an "L" and a "S".
I used:
=COUNTIF(offset(data!$G$3,COUNT(data!$G$3:$G)-B2,0,B2,1),"L")
but it does not work.
I used exactly the same syntax to show positive and negative based on column R:
=COUNTIF(offset(data!$R$3,COUNT(data!$R$3:$R)-B2,0,B2,1),"<=0")
and it works pefectly as shown in the sheet WEEKLY, B9 and B10.
I can easily count Ls and Ss with a simple formula like:
=countif(G1:G1257,"=L")
but I need all the offset thinghy...
My question is:
How can I count the S and L in the G column of the data sheet maitaining the same offset fuction I used to count positive and negative on the R column?
Your formula with column R works with COUNT because the values in column R are numeric and COUNT counts cells which contain numbers.
It doesn't work with column G because it contains text so you need to use COUNTA
=COUNTIF(offset(data!$G$3,COUNTA(data!$G$3:$G)-B2,0,B2,1),"L")
The formula should sum up the column C based on Column A and B when two column value matches and displays the sum value only in the first cell D2 of Column D as shown in figure "60" & "67".
I am trying with SUMIFS but not getting the Output as required.
=SUMIFS(C2:C6;A2:A6;"A:A";B2:B6)
Try this formula in cell D2:
=IF(SUMPRODUCT(--($A$2:$A2&$B$2:$B2=$A2&$B2))=1,SUMPRODUCT(--($A$2:$A$6&$B$2:$B$6=$A2&$B2),$C$2:$C$6),"")
It should give expected output.
It might also be better/more efficient if you create a helper column (which stores concatenation results, instead of doing the concatenation multiple times in each formula).
Each code from A column has a defined value in the B column (B1 to A1, B2 to A2, etc.). The same for D and E columns.
I'd like a formula that gives me all the values related to a determined code that i put on cell F1, with non repeated values (i need unique values), as shown in G column.
I´ve tried with thousand variations of this formula,
{=INDEX(B:B;SMALL(IF(A:A=$F$1;ROW());ROW()))}
The best I could do was only to get results just from one column, and with repeated values, as shown in the I Column
Here is a photo for guidance
I'll apreciate some help
you would definately need service columns to the left of the "i" column that would contain the nex formula
(formula next to the left of the "i" column):
=if(countif(i$1:i1;i1)=1;row();"---")
(formula next to the left of the above formula):
=iferror(rank(H1;H;1);"---")
then you will need a numerated column from 1 to max possible entries of the values, and a VLOOKUP function to get your unique values:
=vlookup(your_enumerated_cell;G:I;3;false)
and your done getting unique values from the dataset
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
Screenshot of the Excel worksheet
I'm working with historic stock prices, and using eight columns I have:
Column A: High
Column B: Low
Column C: Close
Column D: Cx-Cx-4
Column E: Counts the number of consecutive positive numbers in column D
Column F: Counts the number of consecutive negative numbers in column D
Column G: Calculate the difference between the maximum of column A and minimum of column B within a given sequence.
As an example G1 should equal:
=max(A1:A5)-min(B1:B5)
G6 should equal:
=max(A6:A8)-min(B6:B8)
G9 should equal:
=max(A9:A11)-min(B9:B11)
And so on.
I'd like to know if it is possible to automate this calculation, possibly with the use of one or more additional columns.
Welcome to SO!
This may not be the most efficient solution as you need to add two helper columns, but if I understand your requirements correctly, then this idea should work well enough.
First, let's assume that there are 100 rows in your data set. Given that, enter the formula "=A100" in cell G100 and the formula "=B100" in cell H100. This sets up the boundary condition for the formulas in columns G and H. Now, in cell G99, enter this formula:
"=IF(E99="",G100,IF(E100="",A99,MAX(A99,G100)))"
What this formula does is set up a "running maximum" with the following logic:
If the cell in E99 is blank, copy the running maximum from G100, else:
If the cell in E99 is not blank but the cell in E100 is, set up a new running maximum from the cell in A99, else:
Take the maximum of A99 and G100 as the new running maximum.
Similarly, copy the following formula into cell H100:
"=IF(F99="",H100,IF(F100="",B99,MIN(B99,H100)))"
This follows the same logic as the previous formula, but takes the minimum of column B.
Copy or autofill these formulas to the top of the data set. This should now give you running maximum for column A and a running minimum for column B.
The next step is to calculate the difference. I notice from your question, that you only seem to be interested in calculating this difference at the top of each range (G1, G6, G9, etc.), rather than doing it in every row. Given that, we need a slightly more complicated formula.
The boundary condition for this formula is simply "=G1-H1" entered in cell I1. In cell I2, enter this:
"=IF(OR(AND(E2<>"",E1=""),AND(F2<>"",F1="")),G2-H2,"")"
How this works is that it check two conditions that indicate a range boundary:
E1 is blank and E2 is not
or
F1 is blank and F2 is not
If either of these conditions hold, the IF statement is true and "G2-H2" is diplayed, otherwise a blank cell is displayed. Now copy or autofill this formula to the bottom of the data set.
As a final step, you can now hide columns G and H if you don't need them displayed. This should now give you the results I think you're looking for. Please let me know if this doesn't work out for you.