Return a Value from the first Column matching Max() - excel

I have a table:
A B C D
2 10 70 45
2 20 80 55
3 30 90 65
3 40 15 76
4 50 25 85
4 60 35 95
I want to get the maximum from the array B1:D6 which is 95 and return
the value of the first column A which is 4

Insert a new column before column A and put the following formula in cell A2 and drag down:
=MAX(C2:E2)
Then put the following formula in cell H2:
=VLOOKUP(MAX(A2:A7), A2:B7, 2, FALSE)
Result:

Related

Replace and update columns in excel

Table
A B C D E
1 Jan Feb Mar Apr Jun
2 24 32 64 54 45
3 66 76 76 76 87
4 45 65 84 67 23
the last 3 columns should automatically update in another column as
Last 3 moths data
AN AO AP
1 Month1 Month2 Month3
2 64 54 45
3 76 76 87
4 84 67 23
If I add another column in the first table as july in columns F. Then it should automatically replace the data in Month3 in second table and month3 data sholud move to month2 and month2 to month1.
=IF(AN2="",AL2,IF(AO2="",AM2,IF(AP2="",AN2,IF(AQ2="",AO2,IF(AQ2<>"",AP2,IF(AP2<>"",AO2,IF(AO2<>"",AN2,IF(AN2<>"",AM2,""))))))))
The formula is simlar to the another columns.
With any version of Excel:
You can detect where the columns end using many methods - the simplest is using Count.
Enter the following into the top left of your result table:
=INDEX(2:2,,COUNT(2:2)-2)
This counts the number of cells with data in, and returns the data from that numbered column (offset to the left by 2). In the next cell to its right, change the -2 to -1. In the last cell, change the -1 to -0 or remove that part entirely.
Then copy the cells down to match your source table.
If you have Excel-365 then use below formula.
=INDEX(A1:Z4,SEQUENCE(ROWS(A1:A4)),SEQUENCE(1,3,MAX(IF(A1:Z1<>"",COLUMN(A1:Z1),""))-2))
If you don't have Excel-365 then use below formula then drag down and across as required.
=INDEX($A$1:$Z$4,ROW($A1),MAX(IF($A$1:$Z$1<>"",COLUMN($A$1:$Z$1),""))-3+COLUMN(A$1))
If you have ms365, try to use FILTER(), for example:
Formula in G1:
=FILTER(Table1[#All],COLUMN(Table1[#Headers])>COLUMNS(Table1[#Headers])-3)
If you add columns:
If you remove columns:

Find out minimum value of specific columns in a row in MS Excel

My table in Excel looks something like this:
abcd 67 94 52 89 24
efgh 23 45 93 54 34
ijkl 64 83 23 45 92
mnop 34 45 10 66 53
This is a student database containing marks obtained in various subjects. I need to calculate the percentage in each row such that out of 5 subjects, the first subject is always included with other 3 subject with maximum marks.
Example: abcd 67 94 52 89 24 75.5%
Here 75.5%=(67+94+52+89)/4=302/4=75.5 where 24 being the lowest has been excluded and 67 has to be taken even if it were the least.
What I require is the least(excluding the first column, of course) of all the columns in that particular row, so that I can sum all the marks and subtract this least marks and finally use it to calculate the percentage.
Any help/suggestion would be appreciated. Thank You.
You'll need to adjust this for your columns, but if you sum the entire range, then subtract the min value after, do a count of the range then subtract one from that, you will be able to get the average.
This code is using the 4 values from column B through F and the 4 values are: 67 94 52 89 24... which results in 75.5
=(SUM(B3:F3)-MIN(C3:F3))/(COUNT(B3:F3)-1)

EXCEL: Sum columns based on common index

I'm trying to sum columns that have a common index but the difficulty is that the index is not in the same row.
Here is an example
DayIndex2018 Value2018 DayIndex2017 Value 2017
empty empty 1 20
1 50 2 45
2 60 3 55
3 70 4 33
4 32 5 23
What I would like is to have the sum of "value 2017" for indexes that are in common with indexes for 2018: 20 + 45 + 55 + 33
I though of doing this with a sumif but rows need to be perfectly aligned.
Any idea of how I could do this?
Thanks
Use sumproduct to sum the array of sumif
Formula in cell F2:
=SUMPRODUCT(SUMIF(C2:C6,A2:A6,D2:D6))

How to paste list of values into cells of same columns based on equal intervals in excel?

Like i have list of some numbers and i wanted to paste those values in cells such as A1 which get first value then A9 get second value similary.
I want solution of this without using macros.
A B C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
The value which I have are:-
87
75
67
74
94
99
98
80
64
65
59
77
97
99
so I wanted that value 87 goes to A1 then 75 goes to A9 then 67 goes to A18 and so on..
Start in B1: =A1 just for the first (your list is in A1:A14 for example)
In B2 write the following:
=IF(MOD(ROW(),9)=0,INDEX($A$1:$A$14,INT(ROW()/9)+1,1),"")
Mod(Row(),9)=0 to test if the row is the 9th after the precedent Value
Int(Row()/9) to get from the list in A the next row
IF to return empty
You can drag it down
When finish copy column B paste special Values in a new column and you can work with it normally

Paste subsequent values in excel with condition

I have data in an Excel sheet as:
Column A Column B
1 1
5 5
6 6
50 50
.. 51
.. 52
.. 53
1 1
5 2
6 6
50 50
.. 51
.. 52
.. 53
very long list
I want to fill Column B corresponding to Column A as shown above that if cell A is not blank then cell B will have same value as A ..and if Cell A has value 50, then next blank rows in column B will have subsequent values after 50 ..
I tried to make formula
=IF(A2="",IF(A2=50,50,VALUE(A1)+1),A2)
and pasted in Cell B2 and dragged but it is giving me wrong results:
5
6
50
51
1
1
..
Can anyone please suggest? Thanks in advance.
This assumes your data starts in row 2. Paste in B2 and fill down.
=IFERROR(IF(A2<>"",A2,IF(OR(AND(A2=50,A3=""),B1>=50),1+B1,"")),"")
This works on your use case, but it's all kinds of kludgy so might not extend well to other cases.
You can simply paste in B2
=IF(ISBLANK(A2),B1+1,A2)
and then copy the formula by dragging it down
Outcome:
A B
---------
1 1
5 5
6 6
50 50
51
52
53
1 1
5 5
6 6
50 50
51
52
53
Note: it won't work for B1. You have to have enter a value in this cell manually.

Resources