With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Hi guys,

I haven't been able to do this in Excel 97 or Excel 2000... Is it possible to use MATCH or another function to find the position of the first blank cell in a single-column range?

I want the formula to return 7 if A7 is the first empty cell in column A.

It is important that this works correctly, even if there are used cells below the first empty cell.

(I want a normal worksheet formula. NOT a VBA solution. NOT an array formula.)

This doesn't work (it returns #N/A!):

=MATCH("",A:A,0)

Ture Magnusson

Karlstad, Sweden

I haven't been able to do this in Excel 97 or Excel 2000... Is it possible to use MATCH or another function to find the position of the first blank cell in a single-column range?

I want the formula to return 7 if A7 is the first empty cell in column A.

It is important that this works correctly, even if there are used cells below the first empty cell.

(I want a normal worksheet formula. NOT a VBA solution. NOT an array formula.)

This doesn't work (it returns #N/A!):

=MATCH("",A:A,0)

Ture Magnusson

Karlstad, Sweden

You are right, of course; I have been struggling with this for a few days, trying to find a non-array solution to Argmyster's Christmas question, but without success.

I find it strange that it's so hard to do this kínd of thing with MATCH.

Thanks for leaving the question unlocked.

/Ture

=OFFSET($A:$A,0,0,COUNTA($

and then in the cell you want the result:

=MATCH(0,MyRange,-1)+1

antrat

=OFFSET($A:$A,0,0,COUNTA($

and then in the cell you want the result:

=MATCH(0,MyRange,-1)+1

antrat

Thanks for your suggestion, but unfortunately it will not work if several areas in column A are used.

If values are entered in A1:A6 and in A50:A56 and A70:A71, the functon should return 7, which is the position of the first empty cell in column A.

Actually, Excel wouldn't even accept a named range referring to the formula you suggested.

/Ture

Say the range you want to test is in column A (A1:A27), in cell B1 put the formula =ISBLANK(A1) and copy it down the length of the range. Name that range (B1:B27) as "Test1"

In C1 put the formula:

=MATCH(TRUE,Test1,0)

I constructed range "Test" in col A (A1:A27) with A1:A6, A13:A18, and A24:A27 having entries. My answer in cell C1 was 7.

Hope you can use this.

good luck as usual...

and Happy Holidays.

Thanks for your comment. Your solution works, but as you write - it is a work around and not what I am looking for.

What I really want is a non-array, non-VBA formula that works by itself, without extra 'assisting' cells. I can accept assistance by named ranges, but I'm not willing to use extra cells for this calculation.

I hate to be so picky, but I have put a lot of thought into this problem myself during the last few days and I'm looking for the good, solid solution that I couldn't come to think of.

/Ture

Since it's obvious that the lookup functions won't accept a blank value for their lookup value, and you don't want to use additional cells to flag the entries, it sounds like you must come up with another scheme for identifying the blank cell. One way might be to put a placeholder (like *space* or 0) in the cell instead of just having it blank (don't know if that's an option). Then the lookup functions could pick it up.

If you consider the additional cells I mentioned "a named range", could you "hide" it by putting the Test1 range on another (hidden?) worksheet out of the way? Interesting question.

good luck as usual...

Thanks again for your comments.

Actually, finding the first blank cell in column A is not a problem. I know of several ways to achieve that. Cheating by searching for space or zero is not an option.

The challenge is to do it with only a worksheet formula. It bugs me that I can't find a way to do this with the MATCH function. I guess it just can't be done that easily.

/Ture

Without getting to involved here, I would say that no built-in Functions or formula using various Functions in Excel can find the First blank cell in a range and provide the desired effect you are looking for.

I can sum up the row numbers that are blank by using this little jewel:

=SUM(IF(ISBLANK(A1:A10),RO

Ctrl + Shift + Enter (of course)

What ever rows are blank, the row numbers will be added up. This don't help because the sum of the rows is really of no value in your case.

The problem with trying to use built-in functions to do what you ask, is that most functions don't stop at a first occurance of something, except for the LOOKUP, SEARCH, MATCH, FIND etc...and you have already determined that "" won't work with LOOKUP's & MATCH's.

So with this in mind, you may have to except this limitation of Excel's built-in functions. I would say the only way to accomplish this would be a User Defined Function written in VBA.

Argmsyter...

Again, you never know, someone out there may find some obscure way to get at it, but I wouldn't think it could be possible without VBA.

Glad to see you here!

Your formula works quite well to find the first blank cell in column A, if we only change SUM to MIN (and add some size to it).

=MIN(IF(ISBLANK(A1:A65535)

Actually, I used this technique in a recently posted question. But it IS an array formula...

/Ture

Anyway I'm having fun trying. I have not solved the problem yet but in trying I have found a much cleaner and simpler way to make a Dynamic Range that will include an infinite amount of blank cells between data.

Place this in the insert name refers to box:

=OFFSET($A$2,0,0,MATCH(100

the number 1000000000 is just a ridiculously high number that won't actually match any numbers in the range.

anyway back to the drawing board

antrat

Here's a neat little array formula that will return the row number of the first blank cell in a range. First make a dynamic named range as described above called MyRange the use this:

=MATCH("0",MyRange & "",-1)+1

(Still not an answer to my question, but it's getting closer...)

You could actually avoid guessing the size of the 'ridiculously high number' by replacing it with MAX($A:$A)

=OFFSET($A$2,0,0,MATCH(MAX

(At first, I thought that I had to search for MAX($A:$A)+1, but that's not necessary.)

Good things to know when struggling with problems like this - My tips to check the resulting MyRange:

Tip 1: =ROWS(MYRANGE)

Tip 2: Ctrl+G (Goto), Type 'myrange', Enter

/Ture

The MATCH("";MyRange & "";-1) function just gives me a #VALUE result, with MyRange defined as you did.

What's happening here. Would the ";" notation instead of "," do any harm or cause any difference??????

Calacuccia

Did you enter it as an array? ie Ctrl+Shift+Enter

antrat

It was late and I totally missed the MIN vs. SUM in my comment.

I don't believe you will find a solution without using the Array Formula Foundation in Excel.

But, we will see...if it can be figured out, here is the place it will be done.

Argmyster...

thanks a lot, I rarely used array functions (and never to return a single result).

Anyway, still don't believe there's any way to make Excel find the blank cell by using the standard functions. Tried some things, but nothing gets past the #N/A result.

Calacuccia

Ok here is how it can be done:

1:Create a Dynamic Named Range called "MyRange" refined even futher than before but will still not go past the last entry, but will include all blank rows:

=OFFSET($A$2,0,0,MATCH(,$A

2:Create another Dynamic Named Range called "AntratsRange" like below:

=OFFSET($A$2,0,0,MATCH("",

3:Enter =Rows("AntratsRange") in any cell and you have the answer.

antrat

Good Work!

The Dynamic Named Range is very powerful once you understand it!

Merry Xmas

Argmyster...

Actually, after looking at the results, I believe you might want to change the first Dynamic Named Range to:

=OFFSET($A$2,0,0,MATCH("",

for the true row number to be displayed by the formula =Rows(AntratsRange)

Argmyster...

Dang, I forgot to change your formula, sorry.

Argmyster...

=OFFSET($A$2,0,0,MATCH(MAX

instead of:

=OFFSET($A$2,0,0,MATCH(,$A

and to get the right row number as Argmyster has said, I think you would be better off using:

=Rows(AntratsRange)+1

That way neither Dynamic Named Ranges will include the heading.

antrat

You were the first to give me a correct answer to my question. You wrote 'No'. It's not what I hoped for, but unfortunately it seems to be the correct answer. Therefore you will receive 200 points.

antrat,

Your answer does not satisfy all requirements, because your named range actually refers to an array formula. But you have given valuable input, so you'll receive 200 points in a separately posted question.

Argmyster,

Your Merry Christmas question is the reason why this question was posted at all. Because og you, we have all been able to share interesting ideas and come up with interesting solutions. Thanks! 200 points for you in a separate question!

tomk,

Your suggestion wasn't really what I was looking for. But I see you are relatively new at Experts Exchange so I'd like to give you a 'welcome gift'. And I like your info page. And what-the-heck-it's-Christm

Merry Christmas, All!

/Ture

Merrry Xmas

When using a formula to define a name, you can (in some cases) use an array formula as part of the definition. Here is an example:

In this formula, used to define MyRange...

=OFFSET($A$2,0,0,MATCH(TRU

....this part is actually an array formula

MATCH(TRUE,ISBLANK($A$2:$A

MY APOLOGIES...

After examining your post again, I see that your solution was not an array formula. It was based on the use of two separate range names and I wrote in one of my comments to tomk that 'I can accept assistance by named ranges, but I'm not willing to use extra cells for this calculation.'

CONGRATULATIONS!

You have answered my question and solved the problem, meeting all of my requirements!

(But the points for this question have already been awarded to Calacuccia, who gave a correct answer based on the information available at the time of his posting.)

/Ture

Thanks for the gift!

Argmyster...its good to see a plan come together.

Thanks for the X-mas gift.

Antrat, and everyone,

Have to add to this discussion that Antrat's solution is still an Array solution.

In the AntratsRange formula, Antrat uses the Match function written as:

MATCH("",MyRange & "",-1)

Well, this function on itself is an Array function, so even when the final formula is just =Rows(AntratRange) which is not an array function, he still uses an array function in the named range definition.

In my opinion, this is not the easy way to find the first empty cell Ture was looking for.

It still is a great workaround AntraT.

God Jul,

Calacuccia

What confuses me is that the formula doesn't seem to fit the requirements to be an "array" and only refers to a single range.

From help:

Array formulas act on two or more sets of values known as array arguments. Each array argument must have the same number of rows and columns. You create array formulas the same way that you create basic, single-value formulas. Select the cell or cells that will contain the formula, create the formula, and then press CTRL+SHIFT+ENTER to enter the formula.

antrat

All Courses

From novice to tech pro — start learning today.

this is a come-out of Argmysters question, isn't it. This is what I've been looking for for 2 days after you having posted the first answer on his question. My answer to your question, from this experience is simply: NO (and I'me sure you basicly came to the same conclusion during thee last days).

Surprisingly enough.

Cheers, Calaccucia.

PS This is my answer, but I don't post as an answer, want to see others opinion.