Find last column with text, then display text from row 1

slam

Well-known Member
Joined
Sep 16, 2002
Messages
913
Office Version
  1. 365
  2. 2019
Hi all!

Hope everyone is having an excellent 2020 so far!

I have a fairly simple spreadsheet where each column from E to BF represents a week with the week name in row 1. For each row, I am trying to detect the last column that includes text, and when the last instance is detected, I want the formula to display the text from row 1 of each respective column. In other words, I am trying to show the last week where there is text in a column.

There are often blanks in each row, so for instance, there may be text in column H, but then nothing in I or J, then text in K again, and so on. If there was no more text in any columns after K, then I'd want the contents of K1 to be the result of my formula.

Looking to add my formula to D2 and down.

Any help would be greatly appreciated!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
try

=LOOKUP(2,1/(E2:BF2<>""),E2:BF2)

and copy down
 
Upvote 0
Perfect, thank you!

Tweaked it to this, but does exactly what I want!

=LOOKUP(2,1/(E2:BF2<>""),E$1:BF$1)
 
Upvote 0
Perfect, thank you!

Tweaked it to this, but does exactly what I want!

=LOOKUP(2,1/(E2:BF2<>""),E$1:BF$1)
you're welcome.
I missed the bit about Row 1, it's Friday afterall
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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