Find column header based on row value

rtlane84

New Member
Joined
Jun 18, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Any help would be appreciated
I have a table like this:

2468
1001.52.22.83.1
2001.11.72.73.2
3001.82.63.53.9
4001.62.13.34.4

I have a lookup value for column A already. I want to find the column header for the first value found that's greater than or equal to 2. For example, if my lookup is 400, then I want to return the column header 4 since 2.1 if the first value greater than or equal to 2.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFGH
12468
21001.52.22.83.12006
32001.11.72.73.2
43001.82.63.53.9
54001.62.13.34.4
Master
Cell Formulas
RangeFormula
H2H2=INDEX(B1:E1,AGGREGATE(15,6,(COLUMN(B1:E1)-COLUMN(B1)+1)/(INDEX(B2:E5,MATCH(G2,A2:A5,0),0)>2),1))
 
Upvote 0
Thank you Fluff that worked perfectly. Can you break this down for me? The main part I'm hung up on it the array portion of the aggregate formula...(COLUMN(B1:E1)-COLUMN(B1)+1)/(INDEX(B2:E5,MATCH(G2,A2:A5,0),0)>2)
 
Upvote 0
The first part gives an array of numbers
{1,2,3,4}

The index/match returns the values in the found row
{1.1,1.7,2.7,3.2}

which is check to see if its greater than 2 & gives an array of true /false
{FALSE,FALSE,TRUE,TRUE}

The 1st array is then divided by that array to give
{#DIV/0!,#DIV/0!,3,4}

and the aggregate function then returns the smallest number ignoring errors
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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