Average of Maximum Between Columns - excel

An excel table have two columns of grades. I would like to calculate the average grade but adding only the maximum grade of each row.
It is possible to do this by adding additional column that would contain max of each row and calculating the average of it. I am interested to know if there is a cleaner solution that relies only on formulas.

Let's say in cell A1, you have the heading "first" and in B1 you have "second"
In cells A2 to B4, put in your number grades. Use the following formula in D2.
=AVERAGE(IF(A2:A4>B2:B4,A2:A4,B2:B4))
Hit ctr+shift+enter so that the formula has curly brackets and looks like so
{=AVERAGE(IF(A2:A4>B2:B4,A2:A4,B2:B4))}
This is an array formula and so it's looking at A2, checking if it's higher than B2, if so, it takes A2, otherwise takes B2. It then does this again with A3 and B3 etc and builds up an array of the figures you need to calculate the average (but doesn't show them to you).
The average on the outside is then calculating the average of the numbers in the array.
This assumes your grades are number scores and not letters. Apologies if my assumption is incorrect.

If you want to use the helper column, you could use the formula MAX().
Example: =MAX(A2:B2) would give you the larger of the two. Just copy down the column.
Then you could still use the AVERAGE() function to average the numbers in that column.

Related

How to simplify the formula for sums with one variable in Excel

I need to sum the result of a formula, repeated several times, which has a single value that changes from 1 to 180.The final formula must be contained in a single cell.
Column A contains values ​​from 1 to 180 (to simplify in the example I have only put 13).
Cell B1 contains a value expressed as a percentage.
Column C (C1 to C13) contains the following formula (cell C1 in the example):
=+((1/(1+(A1*1/12*$B$1)))).
Cell C14 contains the sum of all results.
By defining X the variable value of column A, the formula is in practice the following:
Column A will be not present in my sheet, so therefore I cannot refer my formula to the contents of any cell.
My need is to have only two cells in my sheet: B1, with the rate value; and C1, with the sum of the products with X from 1 to 180. That is what is contained in cell C14.
Thanks for your help and for your patience with my bad English.
This can be done using SUMPRODUCT:
=SUMPRODUCT(1/(1+(A1:A13*1/12*$B$1)))
You can use the SEQUENCE() function for your problem to replace the column A in your example.
More specifically, you can write the formula:
=1/(1+SEQUENCE(180)/12*B1)
which will automatically create an array with a length of 180 cells returning your desired series of values.
If you don't want to 'print' out that series at all but only show the sum right away, simply enclose the formula with the SUM() function:
=SUM(1/(1+SEQUENCE(180)/12*B1))

Within rows multiplication Excel

I am in need of some help with multiplication in Excel. What I want to do is to multiply all the values in the cells of one column with the values of cells in another column.
Say I have a column A and a column B. In the cells A1...An of column A there are some values. Now I want the values of A1...An to be multiplied with the values I input in B1...Bn. In particular, I want what I input in A1 to be multiplied by what I input in B1, what I input in A2 by what I input in B2 and so on and so forth.
In the cell A1 I have the value ‘1’, say. In the cell A2 I have the value ‘2’. In the cells with which I want to multiply these values (cells B1 and B2) I have the formulae =0,4*A1 and =0,7*A2 (0,4 and 0,7 are just variables). Essentially, 1 and 2 are the amounts I have of an item, the price of which I have in the B cells (0,4 and 0,7). So I am multiplying the amount of an item with its price.
I hope my explanation makes sense.
Thanks in advance!
While you spend a lot of time explaining your data, you don't really explain what you want very well. It sounds to me like you want to multiply values in Column A with values in Column B and then ADD all of those results up. If this is true, then a sumproduct formula is what you want:
=SUMPRODUCT(A1:An*B1:Bn)
This will multiply each column, row by row, and add the results of those multiplications together.
From your question. this is what I was thinking?
=A1*(0.4*A1)
=A2*(0.7*A2)

Excel SUMIF function sums multiple and/or wrong column.

I'm having an issue getting accurate data from the SUMIF function. This appears to be caused by the SKU and Product name being identical however I don't understand why the selected range would be ignored.
SUMIF(G:K,A2,K:K) - Cell D2 is calling for the sum of K yet returning the sum result of K2:M2. All other results in D are correct.
SUMIF(G:K,A2,I:I) - If I change the formula in D to SUM I:I (text not a numeric field) the function returns the sum of K:K
Example file http://tempsend.com/013C2B6378
According to the documentation here the range to be summed starts at the top left of the sum range (K:K in your first example) but its size is given by the size of the criteria range (G:K in your example). So I think that's why you're getting extra columns summed in your result.
If you have multiple criteria involving different columns, you should be able to use SUMIFS.
So let's say your data sit in 8 rows (including the headings).
then you simply need to change your formula to say, look for B2 in column G OR in I, if true, then sum the values in K. Right?
put this formula in B2 and press ctrl+shift+enter to calculate the formula.
=SUM(IF(($G$2:$G$8=B2)+($I$2:$I$8=B2),1,0)*$K$2:$K$8)
then drag and fill down until the last cell.
obviously you need to adjust the ranges in the formula to adapt to your own data.
tell me if you get to the answer via this.

Excel - Find the biggest gap in a set of numbers?

I have a series of numbers
0,1,99,5,5,98,9
They are unsorted and will remain that way.
I cannot use macros.
I want the answer 89 from a formula or an array formula.
89 is the biggest gap (between 9 and 98) in this series when sorted.
I want a formula, no vba, and no sorting my column or row.
I need a formula that sorts the list and subtracts one cell relative to the sorted list and gives the largest difference of the list of differences it creates.
so the list becomes 0,1,5,5,9,98,99
subtracts the current from the previous (na,1,4,0,4,89,1)
and gives me the max 89.
My list is a column of 7 rows.
This formula must be array-entered. In the formula RNG refers to the range where you have entered your numbers, e.g. A1:A7
=MAX(LARGE(RNG,ROW(INDIRECT("1:"&-1+COUNT(RNG))))-
LARGE(RNG,ROW(INDIRECT("2:"&COUNT(RNG)))))
To array-enter a formula, after entering
the formula into the cell or formula bar, hold down
ctrl-shift while hitting enter. If you did this
correctly, Excel will place braces {...} around the formula.
You can see how the formula works by using the Evaluate Formula option on the Formula Auditing tab of the Formulas ribbon.
In brief, the formula works by creating two arrays, sorted in order of size. The "K" value of the LARGE function is an array created by the ROW(INDIRECT sequence. The first returns
{1;2;3;4;5;6}
and the second returns
{2;3;4;5;6;7}
The two arrays of values returned would then be:
{99;98;9;5;5;1}
{98;9;5;5;1;0}
Subtracting one from the other results an array of the differences, and we find the MAX.
MAX(A:A) - LARGE(A:A,2) gives the difference between the largest and second-largest value if your numbers are in column A. Don't put this formula in column A.
Place the values in A1 thru A7 in any order!
In B1 enter:
=RANK(A1,$A$1:$A$7,0)+COUNTIF($A$1:$A1,A1)-1
and copy down thru B7
In C1 enter:
=INDEX($A$1:$A$7,MATCH(ROW(),B$1:B$7,0))
and copy down thru C7
In D2 enter:
=C1-C2
and copy down thru C7
Finally in E1 enter:
=MAX(C:C)
Column B represents the order of the values in column A if they were sorted. Column C contains the values of column A in sorted order. Column D are the differences and E1 gives the desired answer. Here is an example:

In Excel, what formula can I use to repeat text in one cell, for a specified amount of times in consecutive rows?

In Excel, what formula can I use to repeat text in one cell, for a specified amount of times in consecutive rows?
Example. A2 is the number of times to repeat, B2 is the amount to be repeated and C2, D2, etc is the cells that must receive the repetition?
In C2 .... X2 where X is as far as you may want to go in terms of columns
[updated:I had transposed A&B]
=IF(COLUMN()-2<=$A2,$B2,"")
and copy right
This works by calculating if the current column position -2 exceeds the value in B2
So is column C-2 (3-2 =1) greater than the value in B2
then is column D-2 (4-1 =2) greater than the value in B2 etc
if you question is more complex than this then you will need to provide further detail

Resources