Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Ref of First Non blank cell

I need a formula to recognize the first non blank cell within an area e.g.
"B2:Z2", and the formula should displayed as address. My appreciation for
any help.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pub pub is offline
external usenet poster
 
Posts: 29
Default Ref of First Non blank cell

"Sampoerna" wrote in
:

I need a formula to recognize the first non blank cell within an area
e.g. "B2:Z2", and the formula should displayed as address. My
appreciation for any help.


so if the 1st non-blank is "hello" in F2 you want to show the address F2

copy&paste this array formula

=CHAR(65+MATCH(INDEX(B2:Z2,1,MATCH(TRUE,LEN(B2:Z2) <0,0)),B2:Z2,FALSE))&2

hit Ctrl-Shift-Enter.
if you hit all 3 keys correctly you will see the curly brackets { and }
around the formula.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Ref of First Non blank cell

On Sun, 1 Mar 2009 08:12:21 +0800, "Sampoerna"
wrote:

I need a formula to recognize the first non blank cell within an area e.g.
"B2:Z2", and the formula should displayed as address. My appreciation for
any help.



This formula must be **array-entered** and will work for single row horizontal
ranges.

=ADDRESS(ROW(rng),MATCH(TRUE,NOT(ISBLANK(rng)),0))


To **array-enter** a formula, after entering
the formula into the cell or formula bar, hold down
<ctrl<shift while hitting <enter. If you did this
correctly, Excel will place braces {...} around the formula.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Ref of First Non blank cell

=ADDRESS(2,MATCH(TRUE,INDEX(B2:Z2<"",),)+1)

Normally ENTER


"Sampoerna" wrote:

I need a formula to recognize the first non blank cell within an area e.g.
"B2:Z2", and the formula should displayed as address. My appreciation for
any help.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Ref of First Non blank cell

Thanks for the responds,

That formula really works. What if without { and }, is there any way to
write the formula which gives
the same result?

I'll be glad to hear if it is possible.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pub pub is offline
external usenet poster
 
Posts: 29
Default Ref of First Non blank cell

"Sampoerna" wrote in
:

Thanks for the responds,

That formula really works. What if without { and }, is there any way

to
write the formula which gives
the same result?

I'll be glad to hear if it is possible.


i took a look at rons formula and noticed errors on my original. i put a
redundant index&match inside a match()...and i hardcoded the row at 2.
also my formula only works up to column Z. so Rons formula with address
() would be the better way to go.

heres a cleaned up formula

=CHAR(65+MATCH(TRUE,LEN(B2:Z2)<0,0))&ROW(B2)

again,its an array, so you needs to hit ctrl-shift-enter.
now once you do that...along with the new row(b2) you can fill the
formula down the column real easy.

it needs { and } because its using match() to find the 1st non-blank
across every cell in the row. the only way around it would be to use a
sumproduct() or an offset() formula of some sort.

the len(b2:z2)<0 looks at the length of the data in every cell in the
range and stores it stores it in memory as a "true" or "false". and this
is why you need to hit ctrl-shift-enter. if you dont, then excel wont
know to store the range into memory, and will only look at 1st cell.

the match() will match the 1st "true" in the len() range and pull the
column#...and add it to the =char(65)
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Ref of First Non blank cell

Hi Pub,

Your second formula is much easier to follow.
=CHAR(65+MATCH(TRUE,LEN(B2:Z2)<0,0))&ROW(B2)

I agree that Ron's formula is much much better, but the result is not quite
right.
Therefore, I added (+1) at the end of the formula e.g.
=ADDRESS(ROW(rng),MATCH(TRUE,NOT(ISBLANK(rng)),0)+ 1)

Thanks to both of you. Both ideas and examples help me alot on my works.

Thanks again.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Ref of First Non blank cell

On Sun, 1 Mar 2009 20:06:11 +0800, "Sampoerna"
wrote:

Hi Pub,

Your second formula is much easier to follow.
=CHAR(65+MATCH(TRUE,LEN(B2:Z2)<0,0))&ROW(B2)

I agree that Ron's formula is much much better, but the result is not quite
right.
Therefore, I added (+1) at the end of the formula e.g.
=ADDRESS(ROW(rng),MATCH(TRUE,NOT(ISBLANK(rng)),0) +1)

Thanks to both of you. Both ideas and examples help me alot on my works.

Thanks again.


Yes, my formula incorrectly assumed that rng began in column A. Your
modification assumes that rng always begins in column B.

To generalize the function, so it will give the correct answer no matter what
column rng begins in, try this **array** formula

=ADDRESS(ROW(rng),COLUMN(rng)-1+MATCH(TRUE,NOT(ISBLANK(rng)),0))
--ron
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Ref of First Non blank cell

Thanks Ron,

That was a nice one. No doubt about the result and really fantastic!

Many thanks.

Cheers ;)

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Ref of First Non blank cell

On Mon, 2 Mar 2009 00:46:13 +0800, "Sampoerna"
wrote:

Thanks Ron,

That was a nice one. No doubt about the result and really fantastic!

Many thanks.

Cheers ;)


You're welcome. Glad to help. Thanks for the feedback.
--ron


  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Ref of First Non blank cell

Here's a non-array version:

Normally entered:

=ADDRESS(ROW(rng),MATCH(TRUE,INDEX(rng<"",0),0)+C OLUMN(rng)-1,4)

--
Biff
Microsoft Excel MVP


"Sampoerna" wrote in message
...
Thanks Ron,

That was a nice one. No doubt about the result and really fantastic!

Many thanks.

Cheers ;)



  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Ref of First Non blank cell

Unbelievable! That was cool.

Thank T.Valko


"T. Valko" wrote in message
...
Here's a non-array version:

Normally entered:

=ADDRESS(ROW(rng),MATCH(TRUE,INDEX(rng<"",0),0)+C OLUMN(rng)-1,4)

--
Biff
Microsoft Excel MVP


  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Ref of First Non blank cell

You're welcome!

--
Biff
Microsoft Excel MVP


"Sampoerna" wrote in message
...
Unbelievable! That was cool.

Thank T.Valko


"T. Valko" wrote in message
...
Here's a non-array version:

Normally entered:

=ADDRESS(ROW(rng),MATCH(TRUE,INDEX(rng<"",0),0)+C OLUMN(rng)-1,4)

--
Biff
Microsoft Excel MVP




  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Ref of First Non blank cell

Hi,

Just came across this thread and thought I would add a few minor comments:

You can shorten the array suggestion to

=CHAR(65+MATCH(1,N(B2:Z2<""),))&2

or make it a longer non-array version

=CHAR(65+SUMPRODUCT(MATCH(TRUE,B2:Z2<"",)))&2

or you can use the short array formula

=ADDRESS(2,MATCH(1,N(B2:Z2<""),)+1)

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Sampoerna" wrote:

I need a formula to recognize the first non blank cell within an area e.g.
"B2:Z2", and the formula should displayed as address. My appreciation for
any help.


  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Ref of First Non blank cell

Thank you all,
You guys are so great! And I feel so lucky having all of you respond to the
threat.
All the best... Cheers!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to return a blank formula cell if the reference is blank? waybomb Excel Worksheet Functions 2 January 22nd 09 05:53 PM
Average Formula to display blank cell if named range is blank Rachael F Excel Worksheet Functions 3 February 22nd 08 05:05 PM
how to get excel to display blank if reference cell blank silent1(not) Excel Worksheet Functions 1 December 2nd 05 02:49 PM
How do I make a blank cell with a date format blank? Pivot Table/Query Excel Worksheet Functions 6 June 14th 05 11:19 PM
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. QUEST41067 Excel Discussion (Misc queries) 1 January 15th 05 09:29 PM


All times are GMT +1. The time now is 09:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"