Last non-zero column in row range and return value from different row

KGee

Well-known Member
Joined
Nov 26, 2008
Messages
537
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I want to check a range for the last non-zero value in row 35 from columns R-AC. The value I want to return is the text that matches that column but in row 32. Using the first formula in my current data, it returns a value of 28 which is correct as that corresponds to column AB in this case. The second formula gives me "AB32" which is the cell I want to return. I tried adding the "cell" function in the third formula but it doesn't take as I have it written. Open to alternatives if there is an easier method.

Excel Formula:
=IF(COUNTA(R35:AC35)=0,"",MAX((R35:AC35<>0)*(COLUMN(R35:AC35))))

Excel Formula:
=SUBSTITUTE(ADDRESS(1, IF(COUNTA(R35:AC35)=0,"",MAX((R35:AC35<>0)*(COLUMN(R35:AC35)))), 4), "1", "")&32

Excel Formula:
=CELL("CONTENTS",SUBSTITUTE(ADDRESS(1, IF(COUNTA(R35:AC35)=0,"",MAX((R35:AC35<>0)*(COLUMN(R35:AC35)))), 4), "1", "")&32)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How about
Excel Formula:
=Lookup(2,1/(R35:AC35<>0),R$32:AC$32)
 
Upvote 0
Solution
It always ends up being so simple. That works exactly as needed. Thank you!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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