Percentage Calculation Formula - excel

I am trying to calculate score that has 5 sections( minimum of 3 questions per sections). Among these some can be N/A. I need to calculate in such a way that the first 4 parts should be (Total Yes answers) / (total Yes+NO questions) * 10 and the 5th part should be multiplied by 60. Finally I need to sum all 5 parts to get a final score .
My Solution : (first 4 parts)
=IFERROR((COUNTIF(D70:D72,"Yes")/SUM(COUNTIF(D70:D72,"Yes"),(COUNTIF(D70:D72,"No"))))*10,"N/A")
The above formula continues for other 3 sections with different range values
5th part :
=IFERROR((COUNTIF(D70:D72,"Yes")/SUM(COUNTIF(D70:D72,"Yes"),(COUNTIF(D70:D72,"No"))))*60,"N/A")
Final Score :
=AGGREGATE(9,6,(G30,G42,G52,G64,G73))/100
I tested my formula having one section has N/A and other has YES. This gives me a result of 90% rather than 100%
My question is what if one of the parts is completely n/a. then how I should ignore the n/a section and still get 100%

In your final calculation, rather than dividing by 100 you need to divide by the sum of the possible points. There will be a more elegant way to do this, but since there are only five of them:
=AGGREGATE(9,6,(G30,G42,G52,G64,G73))/SUM(IF(ISERROR(G30),0,10),IF(ISERROR(G42),0,10),IF(ISERROR(G52),0,10),IF(ISERROR(G64),0,10),IF(ISERROR(G73),0,60))

Yeah !It did work Finally ! Thanks a lot for your guidance !
=IFERROR((SUM(G30,G42,G52,G64,G73)/SUM(IF(G30="#N/A",0,10),IF(G42="#N/A",0,10),IF(G52="#N/A",0,10),IF(G64="#N/A",0,10),IF(G73="#N/A",0,60))), "-")

Related

count how often a piece of information appears and calculate that average

I do not want to know the traditional frequency or the traditional averages; so I'll give an example below:
I have this data:
1
3
5
5
2
3
5
5
1
3
The analysis that I would like to obtain is the following:
for example number 1 appears once every eight rows, number 3 appears once every four rows, number 5 appears twice every two rows....
I did it by hand, but now I have more than 21000 rows of data and I'm stuck.
I searched but I can not find a function that does it; But before I started developing my own, I decided to ask for a guide on how to achieve it.
I believe that I was able to achieve the desired result:
The formula is:
Or, if you want to copy/paste:
=IF(CONCATENATE("1-",MATCH(D1,INDIRECT(ADDRESS(MATCH(D1,A1:A17,0)+1,1,4)&":A17"),0))="1-1",CONCATENATE("2-",MATCH(D1,INDIRECT(ADDRESS(MATCH(D1,A1:A17,0)+2,1,4)&":A17"),0)-1),CONCATENATE("1-",MATCH(D1,INDIRECT(ADDRESS(MATCH(D1,A1:A17,0)+1,1,4)&":A17"),0)))
Note that the IF function solves the duplicates (like the number 5). In case you have triplicates you will have to add another instance of IF and adjust the formula accordingly.
Hope that helps!
Well this doesn't exactly reproduce your results, but you could start by looking at the max and min separation of the numbers:
=IF(COUNTIF(A$1:A$10,C2)<=1,"",MIN(IF((ROW(A$1:INDEX(A$1:A$10,COUNTIF(A$1:A$10,C2)+1))>1)
*(ROW(A$1:INDEX(A$1:A$10,COUNTIF(A$1:A$10,C2)+1))<=COUNTIF(A$1:A$10,C2)),
FREQUENCY(IF(A$1:A$10<>C2,ROW(A$1:A$10)),IF(A$1:A$10=C2,ROW(A$1:A$10)))))+1)
=IF(COUNTIF(A$1:A$10,C2)<=1,"",MAX(IF((ROW(A$1:INDEX(A$1:A$10,COUNTIF(A$1:A$10,C2)+1))>1)
*(ROW(A$1:INDEX(A$1:A$10,COUNTIF(A$1:A$10,C2)+1))<=COUNTIF(A$1:A$10,C2)),
FREQUENCY(IF(A$1:A$10<>C2,ROW(A$1:A$10)),IF(A$1:A$10=C2,ROW(A$1:A$10)))))+1)
This gives the min or max number of rows between each occurrence of the particular number.
Must be entered as an array formula using CtrlShiftEnter
You could add other statistics (like mean, standard deviation) the same way although the average could be calculated just by (lastrow-firstrow)/(count-1) e.g. for 5 it would be (8-3)/(4-1)=5/3.

Excluding 'N/A' answers in Excel table

Say I have a table of survey results. The scores for each answer are from 1-4 inclusive (1 worst, 4 best). An 'N/A' answer is represented as 5 - misleading when analysing!
I want to use a function in the final column that calculates the respondent's overall score for the survey. Rather than replacing 5 with 0 for a 'N/A' answer, I'd like to simply exclude that number altogether, and also exclude it from the overall maximum.
For example, say my maximum overall survey score was 80. If someone puts 'N/A' for one question, then I'd like their score to be n / 76, rather than n / 80.
Any suggestions? Feel free to ask for clarification if needed.
EDIT: See below for example image. I'm trying to get Overall Score / Max Score.
So after playing around with the available functions I stumbled across 2: COUNTIF and SUMIF.
As above, I'm trying to calculate Overall Score / Max Score.
So the formula I use is:
=SUMIF(range, "<5") / (COUNTIF(range, "<5")*4)
Stepping through the function:
=SUMIF(range, "<5") calculates the overall score (any number less than 5, ignores text)
(COUNTIF(range, "<5")*4) calculates the number of cells with numbers less than 5, ignores text. I then multiply this by the maximum score for a given question (which was 4). This gives me the maximum score possible given the number of 'N/A' responses.
Finally I divide the former by the latter and get the score I'm looking for. Hope this helps!

Excel: Returning a specific value if found

I want to be able to calculate the average a student, however, if it finds a specific number between the averaged subjects, then it will return that specific number AND NOT calculate the average.
Example:
If Jack has the following averaged grades in some amount of subjects - 2 3 4 5 5 - then I would want Excel to calculate the average. The answer would be 3.8.
However, if Josh has the following averaged grades - 1 2 3 4 5 - then I would want Excel to return 1 has Josh's average because it found a specific given number in his averaged grades, in this example that would be 1. I want it to return 1 as an answer, and not 3.
I don't know if it makes any sense. I tried to make it understandable. I tried mixing up varies functions, but with no results. Do I have to use VBA for that?
Use this formula:
=IFERROR(INDEX(A:A,MATCH(1,A:A,0)),AVERAGE(A1:A5))
Try,
=if(countif(A:A, 1), 1, average(A:A))
=IF(ISNUMBER(MATCH(1,A1:A5)), 1, AVERAGE(A1:A5))
=IF(SUMPRODUCT(--(A1:A5=1)), 1, AVERAGE(A1:A5))

How to calculate average of first two highest number of a range?

write a formula in cell E2 to calculate the average of two highest cumulative numbers among three students after converting the obtained numbers in hundred
To get the maximum you can use max and to get the second largest number you can use large. Add the two numbers and divide them by two:
=(MAX(B3:D5)+LARGE(B3:D5,2))/2
I cannot follow your question fully. Do you want the top 2 grades, even if they are from the same student? Then #Ralph answer does it. It does not however take into account the 30% values you have in row 1.
If you want the top 2 student grades (e.g. each student can only take 1 place). Do this:
Solution

Excel AVERAGEIFS else statement

I'm trying to perform an AVERAGEIFS formula on some data, but there are 2 possible results and as far as I can tell AVERAGEIFS doesn't deal with that situation.
I basically want to have an ELSE inside it.
At the moment I have 2 ranges of data:
The first column only contains values 'M-T' and 'F' (Mon-Thurs and Fri).
The second column contains a time.
The times on the rows with an 'F' value in column 1 are an hour behind the rest.
I want to take an average of all the times, adjusting for the hour delay on Fridays.
So for example I want it to take an average of all the times, but subtract 1 hour from the values which are in a row with an 'F' value in it.
The way I've been doing it so far is by having 2 separate results for each day, then averaging them again for a final one:
=AVERAGEIFS(G3:G172, B3:B172, "M-T")
=AVERAGEIFS(G3:G172, B3:B172, "F")
I want to combine this into just one result.
The closest I can get is the following:
=AVERAGE(IF(B3:B172="M-T",G3:G172,((G3:G172)-1/24)))
But this doesn't produce the correct result.
Any advice?
Try this
=(SUMPRODUCT(G3:G172)-(COUNTIF(B3:B172,"=F")/24))/COUNTIF(B3:B172,"<>""""")
EDIT
Explaining various steps in the formula as per sample data in the snapshot.
SUMPRODUCT(G3:G17) sums up all the value from G3 to G17. It gives a
value of 4.635416667. This after formatting to [h]:mm gives a value
of 111.15
OP desires that Friday time be one hour less. So I have kept one hour less for Friday's in the sample data. Similar SUMPRODUCT on H3:H17 leads to a value of 4.510416667. This after formatting to [h]:mm gives a value
of 108.15. Which is exactly three hours less for three occurrences of Fridays in the sample data.
=COUNTIF(B3:B17,"=F") counts the occurrences of Friday's in the B3:B17 range which are 3 occurrences.Hence 3 hours have to less. These hours are to be represented in terms of 24 hours hence the Function COUNTIF() value is divided by 24. This gives 0.125. Same is the difference of 4.635416667 and 4.510416667 i.e. 0.125
Demonstration column H is for illustrative purposes only. Infact Friday accounted values that is 108.15 in sample data has to be divided by total data points to get the AVERAGE. The occurrences of data points are calculated by =COUNTIF(B3:B17,"<>""""") with a check for empty columns.
Thus 108:15 divided by 15 data points give 7:13 in the answer.
Revised EDIT Based upon suggestions by #Tom Sharpe
#TomSharpe has been kind enough to point the shortcomings in the method proposed by me. COUNTIF(B3:B172,"<>""""") gives too many values and is not advised. Instead of it COUNTA(B3:B172) or COUNT(G3:G172) are preferable. Better Formula to get AVERAGE as per his suggestion gives very accurate results and is revised to:
=AVERAGE(IF(B3:B172="M-T",G3:G172,((G3:G172)-1/24)))
This is an Array Formula. It has to be entered with CSE and further cell to be formatted as time.
If your column of M-T and F is named Day and your column of times is named TIME then:
=SUMPRODUCT(((Day="M-T")*TIME + (Day="F")*(TIME-1/24)))/COUNT(TIME)
One simple solution would be to create a separate column that maps the time column and performs the adjustment there. Then average this new column.
Is that an option?
Ended up just combining the two averageifs. No idea why I didn't just do that from the start:
=((AVERAGEIFS(G$3:G171, $B$3:$B171, "F")-1/24)+AVERAGEIFS(G$3:G171, $B$3:$B171, "M-T"))/2

Resources