Returning column header of first cell above certain value.. with a twist

jellydonut

New Member
Joined
Jun 22, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi all

I'm trying to figure out how to return the column header (i.e. the month) for the first cell in each row. The issue I'm having is that my data contains empty strings, along zeroes and other numbers.

excel help.png


Currently for column F, the formula I'm using is:
INDEX(A$1:E$1,MATCH(TRUE,INDEX(A2:E2>0,),0))

The formula is working correctly for rows 3 and 4, but for row 2 has a formula that is returning an empty string, i.e. "", for cell A2

Because of the empty string, excel is returning "Jan" for cell F2, but I want it to return "Mar" since that is the first month where the value is truly above zero.

How can I fix this?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What about an array function (CTRL+Shift+Enter):

Code:
=INDEX($A$1:$E$1,1,MATCH(TRUE,A2:E2>0,0))
 
Upvote 0
Thanks guys, I finally figured it out:

=INDEX(A$1:E$1,MATCH(TRUE,INDEX(A2:E2+0>0,),0))
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

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