Cell formula...really interesting

ChrisTa

New Member
Joined
Jul 30, 2007
Messages
6
Hi guys,

I am trying to find a formula to do the following :

I have a list of students with their marks (in each subject) for the 1st and 2nd terms.

Looks like this

A B C
Michel 1st term 2nd term
Math 5 7
French 9 6
English 7 8

What I would like to do the following. Using the max function (=max(B2:C5) in a cell (let's say F5) it would like that in the cell F6 the subject appears automatically, so here it would be 9 French

Thanks a lot for your help

Chris
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,772
Book5
ABCDEFG
1Michel1stterm2ndtem
2Math57
3French96
4English78
59French
Sheet1


Formula in F6: =INDEX(A2:A4,MATCH(F5,B2:B4,0))

EDIT: Oops - I stuck the formula in G5 by mistake, but you get the gist.
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
You could use this formula

=INDEX(A2:A5,MIN(IF(B2:C5=F5,ROW(C2:C5)-ROW(C2)+1)))

confirmed with CTRL+SHIFT+ENTER

....but if there is a tie this will only return the first subject.....
 

Forum statistics

Threads
1,181,647
Messages
5,931,210
Members
436,784
Latest member
amuljono

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top