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

MEUserII

Board Regular
Joined
Oct 27, 2017
Messages
91
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Platform
  1. Windows
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:

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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?
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,554
Members
448,970
Latest member
kennimack

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