Obtain average based on multiple criteria from table column - excel

I have a table that more or less looks like this:
Team_Name | Total_Errors | Total_Volume
_______________________________________
Sam | 3 | 1350
Sam | 5 | 1100
Jamie | 7 | 1600
Mark | 3 | 1220
Jamie | 10 | 2100
Mark | 5 | 1300
Sam | 5 | 1100
Jamie | 3 | 1900
Just with a lot more rows. I want to create a formula that calculates the average total_errors for just the numbers corresponsding to Team_names "Jamie" and "Sam".
How do I do this?
Something like Average(If(June(Team_Name)="Jamie","Sam"......?
(the table name is June)
thanks in advance

You can use Sum/Count:
=(SUMIF(A1:A8,"Jamie",B1:B8)+SUMIF(A1:A8,"Sam",B1:B8))/(COUNTIF(A1:A8,"Jamie")+COUNTIF(A1:A8,"Sam"))

I would go with a simple pivot table that uses June as a data source.
Put your Team_Name filed as a rows, and Total_Errors as Values. Change the Field settings of your Total_Errors to be an average, and change how many decimal points you want to see.
You can then apply whatever filters /Slicers you want and get your desired result.
Here's a screenshot (its on MAC, but you'll get the idea)

Assuming DATA in located at A1:C9 enter this formula at F5, note tat the Criteria Range used by the formula is locaed at E2:E4 (see picture below):
=DAVERAGE($A$1:$C$9,$B$1,$E$2:$E$4)

Related

Is there a way to convert a date as 2008.5 (the middle of the year 2008) in a proper date with excel?

I have a series of values (concentrations of ions in the atmosphere) each plotted in function of their date that looks a little bit like this
+---------+----------+---------+
| Year | Sulphate | Nitrate |
+---------+----------+---------+
| 2008.0 | 22.8 | 12.5 |
| 2007.75 | 13.5 | 13.4 |
| 2007.5 | 10.2 | 12.7 |
| 2007.25 | 19.4 | 10.3 |
| 2007.0 | 25.4 | 12.4 |
+---------+----------+---------+
is there a way to convert the year in a proper date? Like, 2008 should become 01/01/2008 (first of jan of 2008) etc.
If you want to display a proper date (middle of the year, a quarter of the year, etc.) then you can try the following formula:
=DATE(LEFT(A1,4),1,1)+(DATE(LEFT(A1,4)+1,1,1)-DATE(LEFT(A1,4),1,1))*MOD(A1,1)
Here's the result:
Another method, that might come a bit closer:
=DATE(INT(A2),MOD(A2,1)*12+1,MOD(MOD(A2,1)*12,1)*30+1)
The formula assumes all months have 30 days.
Understand that, because months have different numbers of days, that a formula like this may not always give an "exact" result.
is there a way to convert the year in a proper date? Like, 2008 should become 01/01/2008
Yes, with the Function DATE:
DATE Function
Also with function LEFT to get the first 4 chars.
LEFT Function
My formula in B2 is:
=DATE(LEFT(A2;4);1;1)
Hope this helps.

To find the minimum and maximum corresponding value in between a range of clubbed values

I am having a small issue with writing a formula. I have my data in this format :
NAME | EXP | SALARY
A | 0.3 | 40000
B | 4.7 | 490000
C | 2.6 | 220000
D | 3.9 | 34000
E | 1.3 | 150000
F | 3.2 | 300000
G | 0.8 | 90000
H | 1.9 | 170000
I | 2.1 | 260000
J | 4.1 | 390000
this is what i want in my output :
EXP-RANGE | MIN SALARY | MAX SALARY
0-1
1-2
2-3
3-4
4-5
i want to find the minimum and maximum salary of people in the experience range
i tried using MIN(IF(<&>)) but it returns #VALUE?
i can also push all this data in to a Database and query it but I would greatly appreciate anyone who could formulate it so that i can work on Excel itself. Data size is 20000+ so i wouldn't prefer filters
Thanks in advance
Use MAXIFS and MINIFS:
=MINIFS(C:C,B:B,">="&LEFT(G2,FIND("-",G2)-1),B:B,"<"&MID(G2,FIND("-",G2)+1,LEN(G2)))
=MAXIFS(C:C,B:B,">="&LEFT(G2,FIND("-",G2)-1),B:B,"<"&MID(G2,FIND("-",G2)+1,LEN(G2)))
If one does not have MAXIFS or MINIFS we can use AGGREGATE:
=AGGREGATE(15,7,$C$2:$C$11/(($B$2:$B$11>=--LEFT(G2,FIND("-",G2)-1))*($B$2:$B$11<--MID(G2,FIND("-",G2)+1,LEN(G2)))),1)
=AGGREGATE(14,7,$C$2:$C$11/(($B$2:$B$11>=--LEFT(G2,FIND("-",G2)-1))*($B$2:$B$11<--MID(G2,FIND("-",G2)+1,LEN(G2)))),1)
AGGREGATE is an array type formula and the references should be limited to the data set.
Assume "Lookup table" put in A1:C11
Criteria with header in G1:G6
In H2 (Min wage), formula copied right to I2(Max wage) and all copied down:
=AGGREGATE(14+(COLUMN(A1)=1),6,$C$2:$C$11/($B$2:$B$11>=IMREAL($G2&"i"))/($B$2:$B$11<-IMAGINARY($G2&"i")),1)
Edit : In convert the criteria "0-1" to complex number "0-1i", the IMREAL() extract the left side number "0", and the IMAGINARY() extract the right side number "1"
=AGGREGATE(14+(COLUMN(A1)=1),6,..., return in Column K =AGGREGATE(15,6,….) and column L =AGGREGATE(14,6,….)

Grouping excel files by Week Number

I am trying to work on a Excel that has a giant amount of data with dates, to simplify I want it to group the different numbers into weeks, allow me to explain:
The actual rows are like:
29-11-2018 | 49 | 1 | 4 |7 | 2
30-11-2018 | 49 | 4 | 0 |2 | 1
Where "49" is the week number from the date. I'm trying to make Excel put together those lines by week and add the other lines, like this:
49 | 5 | 4 | 9 | 3
And this for all the weeks, so I can know the exact number of data for every week.
Is there a way of doing this?
Thanks!
Regards,
Assuming your data is located at A2:F3..
H2 ---> =B2
put
I2 ---> =IF($B1<>$B2,C2,I1+C2)
and drag to L2, then
N2 ---> =IF($B3<>$B2,H2,"")
and drag to R2. Select H2:R2 and drag to the end..
you'll see your intended result in column N to R.

Display Value in cell Y based on greater than, less than of cell X

Here's the scenario. I have a large spreadsheet of candidates for NHS at my school that are given a score by several teachers, community members, etc. I average out their score and then based on that number they are given a score/value from a rubric. I am looking for a formula that will read the value of cell X (their average score) and display a specific value in cell Y(their rubric score). The following is the criteria:
value<2.0, display 0
value>2.0 value<3.0, display 1
value>3.0 value<3.5, display 2
value>3.5 value<3.75, display 3
value>3.75, display 4
I tried looking this up and the closest I found was a formula that I modified to look like this:
=IF(I10="AVERAGE_CHARACTER",IF(I10<2,0,IF(AND(I10>2,I11<3),1,IF(AND(I10>3,I11<3.5),2,IF(AND(I10>3.5,I11<3,75),3,IF(I11>3.75,4,0))))))
All it says is FALSE in the cell. Not sure if I'm using the wrong formula or have a typo in the formula. Thoughts? If there is an alternate or easier method, I'm open for suggestions.
Thanks!
source: http://www.excelforum.com/excel-formulas-and-functions/575953-greater-than-x-but-less-than-y.html
It's easy if you keep the thresholds and the rubric in separate arrays:
=LOOKUP(A1,{0,2,3,3.5,3.75},{0,1,2,3,4})
You might use something like: (value to be changed in A1)
=VLOOKUP(A1,{0,0;2,1;3,2;3.5,3;3.75,4},2)
or having a table like this: (value to be changed in C1)
| A | B |
1 | 0 | 0 |
2 | 2 | 1 |
3 | 3 | 2 |
4 | 3.5 | 3 |
5 | 3.75 | 4 |
=VLOOKUP(C1,A1:B5,2)

Creating pivot tables and tables with relationships

I am doing my final year dissertation research and I just gathered all the results from my questionnaire, from which I got 210 responses.
I am really struggling with Excel here, so I hope somebody can help me with this.
I am running Mac Office 2011. I have a single file which is so composed:
You are a... | You like... | Gender
participant 1 Carrot | blu, red | male
participant 2 Pear | blu | female
participant 3 Carrot | red | female
I was able to create a Pivot table of how "you are a...", like so:
Carrot | 2
Pear | 1
Total | 3
I was also able to convert this total in percentage, by right clicking in the cell and selecting
Field settings > options > Show data as > % of total.
(by the way, there is a way to add another column with percentages next to the original numbers)
Anyway, my issues are the following:
1) how can I see ho many carrots and pears replied to the gender? Something like
Male | Female | Total
Carrot 1 | 1 | 2
Pear 0 | 1 | 1
Total 1 | 2 | 3
2) Also, how many participants liked blue given that the field is single and contains all the values?
ps. all the data is already consistent as apart from a few fields, questions were multiple choice selection
Thank you very much for those who will help!

Resources