Worksheet Function to Find First Cell With Contents in a Ran

MattHyatt

New Member
Joined
Oct 13, 2002
Messages
6
I have a range A1:A100, sometimes with five rows of data, and sometimes with 95 rows of data. I know how to find the first empty row in the range using a macro (thanks to MrExcel), but I would like to get the same information with a worksheet function. Any suggestions?
 
On 2002-10-14 17:56, MattHyatt wrote:
Well, I thought I was home-free, but I'm not. It works fine with numbers, but when I went back to my "real world scenario", I found that it doesn't work when the array is full of text.

There must be some way to get MATCH to convert the text to numbers. Maybe MID or LEN or something. Going back to do some more research. Additional comments welcome.

Thanks!


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

will give the row number if col A is of text type.

If col A is of mixed data type (text & numbers), use:

=MAX(MATCH(9.99999999999999E+307,A:A),MATCH(REPT("z",90),A:A))
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

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