Formula to find the location of a value in a range

woodsy74

New Member
Joined
Jun 29, 2012
Messages
18
Below is a sample of the data set (starting in cell A1) I am working with (the real set has many more rows & columns). I have a formula which will return me the Min value (-2.2) and the Max value (3.0). What I am trying to do is add a formula that will return me the location of where the Min and Max values are located. I would like to return either F6 or NY for the Min value and either E3 or GA for the Max value -- looking to get either the cell location or the column header of where the value is located. It is possible that the Min and Max values will be found in multiple locations. I am only concerned with showing one location (it could be the first or the last it doesn't matter).

Is this something that can be done via a formula? Thanks.

CATXFLGANYNJ
Ap1.22.20.22.7-0.31.2
Or1.52.50.53.001.5
Ba1.12.10.12.6-0.41.1
Pe01.0-1.01.5-1.50
Ch-0.70.3-1.70.8-2.2-0.7
Gr1.02.002.5-0.51.0

<tbody>
</tbody>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hey,

For the data given try these two formulas:

Put -2.2 in cell I1 and 3 in cell J1 then:

I2:
Code:
ADDRESS(SUMPRODUCT(($B$2:$G$7=I1)*ROW($B$2:$G$7)),SUMPRODUCT(($B$2:$G$7=I1)*COLUMN($B$2:$G$7)))

Drag that across to J2.

Change the range to the appropriate range for your entire data set and you should be good to go!
 
Last edited:
Upvote 0
How about


Book1
ABCDEFGHIJ
1CATXFLGANYNJ-2.23
2Ap1.22.20.22.7-0.31.2
3Or1.52.50.5301.5NYTX
4Ba1.12.10.12.6-0.41.1
5Pe01-11.5-1.50
6Ch-0.73-1.70.8-2.2-0.7
7Gr1202.5-0.51
Sheet2
Cell Formulas
RangeFormula
I3=INDEX($B$1:$G$1,AGGREGATE(15,6,(COLUMN($B$2:$G$7)-COLUMN($B$2)+1)/($B$2:$G$7=I1),1))
J3=INDEX($B$1:$G$1,AGGREGATE(15,6,(COLUMN($B$2:$G$7)-COLUMN($B$2)+1)/($B$2:$G$7=J1),1))

@tyija1995
Your formula will fail if there are duplicates.
 
Upvote 0
This worked great until I started changing some of the values within my data set. Before I made changes the Min formula correctly returned $F$6. I then went into cell A2 and entered -2.2 and when I did the Min formula incorrectly returned $K$11 (which is outside my data set). The formula was working with other changes but doesn't seem to work if the Min (or Max) value is listed more than once in the data set. Is there a way around this? I don't care which cell location I receive from the formula as long as it matches the value I am looking for.
 
Upvote 0
Sorry, I didn't see Fluff's reply. So far that updated formula seems to be working returning the column header. What does the 15,6 represent? If my full data set is B2:HV42 will this work?
Thanks!
 
Last edited:
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
Latest member
RandomExceller01

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
Back
Top