last row with data (formula)

MrDoc

Active Member
Joined
Jul 30, 2002
Messages
343
Hi,

After searching Excel Questions, I found the formula
"=match(9.99999999999999E+307;A:A)" which gives me the number of the last row in column A that contains a number.
It doesn't work, however, if the last cell (or all rows in column A, for that matter) contain other kind of data, like text.
How can I find the last row in column A containing text, without using VBA?
Than you for any help.
Best Regards,
MrDoc
 

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.
MrDoc said:
Hi,

After searching Excel Questions, I found the formula
"=match(9.99999999999999E+307;A:A)" which gives me the number of the last row in column A that contains a number.
It doesn't work, however, if the last cell (or all rows in column A, for that matter) contain other kind of data, like text.
How can I find the last row in column A containing text, without using VBA?
Than you for any help.
Best Regards,
MrDoc

What you tried is meant for a range of numeric type.

For a range of type text, use:

=MATCH(REPT("z",255),A:A)

in order to get the position of the last text value.

For the last text value itself, use:

=LOOKUP(REPT("z",255),A:A)
 
Upvote 0
MrDoc said:
Hi,

After searching Excel Questions, I found the formula
"=match(9.99999999999999E+307;A:A)" which gives me the number of the last row in column A that contains a number.
It doesn't work, however, if the last cell (or all rows in column A, for that matter) contain other kind of data, like text.
How can I find the last row in column A containing text, without using VBA?
Than you for any help.
Best Regards,
MrDoc

=INDEX(G:G,MATCH(REPT("z",255),G:G))

=LOOKUP(REPT("z",255),Sheet1!G:G)
 
Upvote 0
Sorry, I forgot to ask how to find the last column with text as well...
Thanks for helping,
MrDoc
 
Upvote 0
MrDoc said:
Sorry, I forgot to ask how to find the last column with text as well...
Thanks for helping,
MrDoc

Do you mean...

=MATCH(REPT("z",255),1:1)

=LOOKUP(REPT("z",255),1:1)

1:1 stands for row 1.
 
Upvote 0
That's it, thank you, Aladin. I also found out that I can use TRIM() to get the exact text, without trailing spaces, like in
"=TRIM(MATCH(REPT("z";255);1:1))"
Best Regards,
MrDoc
 
Upvote 0
MrDoc said:
That's it, thank you, Aladin. I also found out that I can use TRIM() to get the exact text, without trailing spaces, like in
"=TRIM(MATCH(REPT("z";255);1:1))"
Best Regards,
MrDoc

You mean of course:

=TRIM(LOOKUP(REPT("z";255);1:1))

Right?
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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