Bring header value in cell for first non-blank cell in row

sunrise06

Active Member
Joined
Oct 27, 2006
Messages
264
Office Version
  1. 365
Platform
  1. Windows
I would like to find a way to complete the last column using a formula. The results should match year started column.

Any suggestions?



Book1
ABCDEFGHI
1Name20142015201620172018Grand TotalYear StartedYear Started using formula
2Name 118182016
3Name 21215272017
4Name 32942712016
5Name 429292018
6Name 512122015
7Name 64120102014
Sheet1
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
in H2

=INDEX($B$1:F$1,MATCH(FALSE,ISBLANK(B2:F2),0))

use array to enter - CTRL-SHIFT-ENTER

fill down as needed

hth,

ROss
 
Upvote 0
Are you able to explain for me how this formula knows to grab the top row cell value?
 
Upvote 0
the top row if defined by this part: INDEX($B$1:F$1)

this is why it has the absolute reference with the $ signs
 
Last edited:
Upvote 0
I am wondering if you could also provide a formula that would show Year End? Thanks
 
Upvote 0
In relation to the original question, in case you, or another reader, might have the year values in that table populated by a formula I have provided an alternative formula below in H2.
The formula that has been suggested already in this thread would return incorrect results if those values are formula-driven whereas this formula will work with both formulas and constants.
In addition, if you don't like the Ctrl+Shift+Enter requirement, that can be eliminated with a small change to that H2 formula
=INDEX($B$1:F$1,MATCH(TRUE,INDEX(B2:F2<>"",0),0))


I am wondering if you could also provide a formula that would show Year End? Thanks
Is what I have in column I what you mean?

Excel Workbook
ABCDEFGHI
1Name20142015201620172018Grand TotalYear StartedYear Ended
2Name 1181820162016
3Name 212152720172018
4Name 329427120162017
5Name 4292920182018
6Name 5121220152017
7Name 641201020142017
Lookup Heading
 
Upvote 0
Can you explain your I2 formula?
9.99E307 is a very big number. When LOOKUP cannot find that number in B2:F2 it uses the last number in that range (18 in cell D2) and then goes to the range B$1:F$1 in the same position - so gets 2016 in that case.
 
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