Convert Text String to Single Letter Range/Single Number Range?

MEUserII

Board Regular
Joined
Oct 27, 2017
Messages
65
Consider the following two formulas for calculating the last row in a column and last column in a row:

Formula for calculating last row in a column:
=LOOKUP((2), ((1)/((E:E)<>("") ) ), (ROW(E:E) ) )

Formula for calculating last column in a row:
=LOOKUP((2), ((1)/((5:5)<>("") ) ), (COLUMN(5:5) ) )

For the case of calculating the last row in a column I was able to solve this with the following formula:

=LOOKUP((2), ((1)/((INDIRECT((SUBSTITUTE( (SUBSTITUTE( (ADDRESS( (1), (5), (1) ) ), ("1"), ("") ) ), ("$"), ("") ) )&(":")&(SUBSTITUTE( (SUBSTITUTE( (ADDRESS( (1), (5), (1) ) ), ("1"), ("") ) ), ("$"), ("") ) ) ) )<>("") ) ), (ROW(INDIRECT((SUBSTITUTE( (SUBSTITUTE( (ADDRESS( (1), (5), (1) ) ), ("1"), ("") ) ), ("$"), ("") ) )&(":")&(SUBSTITUTE( (SUBSTITUTE( (ADDRESS( (1), (5), (1) ) ), ("1"), ("") ) ), ("$"), ("") ) ) ) ) ) )

Would there by a way to create an active range of: 5:5 (which would be color highlighted to show it's an active range), in order to put in to the formula for calculating the last row in a column?

I tried the following attempt, but it resulted in a #N/A error.

=LOOKUP((2), ((1)/((INDIRECT((RIGHT( (ADDRESS( (1), (COLUMN() ), (1) )), (2) ) )&(":")&(RIGHT( (ADDRESS( (1), (COLUMN() ), (1) )), (2) ) ) ) )<>("") ) ), (COLUMN(INDIRECT((RIGHT( (ADDRESS( (1), (COLUMN() ), (1) )), (2) ) )&(":")&(RIGHT( (ADDRESS( (1), (COLUMN() ), (1) )), (2) ) ) ) ) ) )

Would anyone know how to be able to do this for the creating of an active range of: 5:5 (which would be color highlighted to show it's an active range), in order to put in to the formula for calculating the last row in a column?
 
Last edited:

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
The first thing I would suggest is to stop putting parentheses around things that don't need it. That is very hard to read.

What do you mean by active range exactly, that it's selected or what?

What are you trying to return with the formula exactly?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,950
Messages
5,599,028
Members
414,275
Latest member
Pungie

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
Top