Find the maximum value associated with a specific value in a different column - excel

I need to find the largest value in column B associated with a specific value in column A.
Here's an example of what I mean:
A B
2 1
2 14
2 22
5 6
5 8
5 99
I.e. I want to find the the largest value, 22, in column B on the same row as a 2 in column A.
I'm currently using this to try find the value, however it only finds the first value:
=VLOOKUP(A2, A1:B20, 2, FALSE)

Please try:
=MAX(IF(A:A=2,B:B))
entered with Ctrl+Shift+Enter.

Related

Formula to Find if Number between a Range in 2 Columns and then Offset 1 column

I would like to write an Excel formula that looks at 3 columns and grabs value of the 1st column based on if the search value is in columns 2 or columns 3.
1st Column 2nd Column 3rd Column
a 1 5
b 6 10
c 11 15
Search Value 1: 13 Result: c
Search Value 2: 6 Result: b
Try below formula-
=INDEX($A$1:$A$3,MAX(($B$1:$B$3<=B6)*($C$1:$C$3>=B6)*(ROW($A$1:$A$3))))

Look up for highest value from another column if values are equal excel

***1 2 3***
a 2 3
b 3 4
c 4 3
d 5 2
so I know to get the highest value I do
=INDEX(column1, MATCH(MAX(column3), column3, 0))
... which would give me 'b'
now I want to get the second highest value based on the column 3 but because there are two cells with 3 (which is the second highest value) I want to use the one that has the lowest value in column 2 based on those two rows. Is this possible?
Use a 'helper' column that adds column C + (column B ÷ 10) and use a modification of your original formula on that column.
        
The standard formula in F5 is,
=INDEX(A$2:A$5, MATCH(AGGREGATE(14, 6, D$2:D$5, ROW(1:1)), D$2:D$5, 0))
Fill down as necessary.

Find and add 1 to the highest number in column 2 based on the input in column 1

Using data similar to what's below, I want to fill in B7 with the next highest number that would be in associated with "Del"... the result should be "4". And then continue that in each subsequent row, the number that is returned in the associated cell in column B will be 1 higher than the highest number already associated with that string in A.
A B
1 Del 1
2 Del 2
3 Pho 1
4 Del 3
5 ACF 1
6 Pho 2
7 Del ____
In Column B, you can use =COUNTIF(A$1:A1,A1)
To explain the formula, we want to count from the first row to the current row any values that equal the current row's value.

Return to a specific value in a column, associated with the maximum value in a row

i'm working with excel, and i'm trying to Fill a column (Column E), with the associated value, where the maximum value of a row exists. as an illustration, Within Row 2(B2, C2, and D2), the maximum value is 7. 7 is exists in Column D, and associated with number 3, thus, the result should be 3.
ABCDE
1 1230
2 0173
3 0532
4 4710
what function should I use and how's the syntax looks like ?
Thank you in advance

EXCEL match 2 columns against each other

I have two columns of data, they look something like this:
A B C D
1 2 SOME RECORD
2 6 SOME RECORD
3 10 SOME RECORD
4
5
6
7
8
9
10
So basically column A is a list of indices, where some of them appear in column C with corresponding records saved in column D. Column B is currently empty, and what I want to do is if say index 2 appears in both column A and column C (they matches), then put the record beside C2 in the cell B2. So essentially I want it to look like this:
A B C D
1 2 SOME RECORD
2 SOME RECORD 6 SOME RECORD
3 10 SOME RECORD
4
5
6 SOME RECORD
7
8
9
10 SOME RECORD
Can someone help please?!! Thanks!!!
UPDATE: I tried this and it doesn't work. The data in column D is calculated using a UDF and is refreshing every 1 second. The VLOOKUP function fails even though I can see the 2 indices are the same!! Is it because of the format of the cell or column? I.e. does vlookup compare data type as well?
Assuming your data in A starts from A1 - put in B1 the following and autofill:
=IFERROR(VLOOKUP($A1,$C:$D,2,0),"")
This includes handling of missing values.
You'll want this:
B1=VLOOKUP(A1, C:D, 2, FALSE)
This will look up the value in column A within the array spanning columns C and D. It will give you the value found in the second column (D). FALSE makes it an exact match, otherwise you might get 2 and 20 matching because hey, they're kind of similar...

Resources