Index and Match formula to return header that contains the min value in range

goblue667

New Member
Joined
Aug 12, 2019
Messages
11
Hello i am really struggling with this.

I have a macro that takes raw data into a certain form. My range is AK:CH. However, there are certain columns that I do not want to include in that range. The columns I want to evaluate contains the text "Height".

HTML:
Cells(PoleRow, 3).Formula = "=IFERROR(INDEX($AK$12:$CH$12,1,MATCH(MIN($AK$" & PoleRow & ":$CH$" & PoleRow & "),$AK$" & PoleRow & ":$CH$" & PoleRow & ", 0)),"""")"

or would it be easier to mention specific columns that i do not include ("CC") or is there a way to break up an index array so that it starts and stops before and after a column i do not want??
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Welcome to the Board.

How about:

Code:
    ad1 = "$AK$12:$CH$12"
    ad2 = "$AK$" & PoleRow & ":$CH$" & PoleRow
    
    Cells(PoleRow, 3).FormulaArray = "=IFERROR(INDEX(12:12,SMALL(IF((SMALL(IF(ISERR(SEARCH(""Height""," & _
                                     ad1 & "))*(" & ad2 & "<>"""")," & ad2 & "),1)=" & ad2 & _
                                     ")*ISERROR(SEARCH(""Height""," & ad1 & ")),COLUMN(" & ad1 & ")),1)),"""")"

I assume that "Height" is found in row 12, if not, change the red addresses to where it is.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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