Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Steve-in-austin
 
Posts: n/a
Default From array find corresponding column/row value

This seems so simple but...
I have an array (zero means blank in this example):
A B C D E
1 0 1 0 0 3
2 1 1 2 5 8
3 0 0 0 0 5
etc
How can I find the first non-blank cell in each row and return the column
heading as the result? e.g.
Row 1 = B
Row 2 = A
Row 3 = E


  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default From array find corresponding column/row value

I put this in F2:
=IF(COUNTA(A2:E2)=0,"none!",INDEX($A$1:$E$1,MATCH( TRUE,A2:E2<"",0)))
And dragged down the column.

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Steve-in-austin wrote:

This seems so simple but...
I have an array (zero means blank in this example):
A B C D E
1 0 1 0 0 3
2 1 1 2 5 8
3 0 0 0 0 5
etc
How can I find the first non-blank cell in each row and return the column
heading as the result? e.g.
Row 1 = B
Row 2 = A
Row 3 = E


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Nikki
 
Posts: n/a
Default From array find corresponding column/row value

assuming your data starts from second row and your titles are in first row:

=INDEX($A$1:$E$1,1,MATCH(SMALL($A2:$E2,COUNTIF($A2 :$E2,0)+1),$A2:$E2,0))

"Steve-in-austin" wrote:

This seems so simple but...
I have an array (zero means blank in this example):
A B C D E
1 0 1 0 0 3
2 1 1 2 5 8
3 0 0 0 0 5
etc
How can I find the first non-blank cell in each row and return the column
heading as the result? e.g.
Row 1 = B
Row 2 = A
Row 3 = E


  #4   Report Post  
Posted to microsoft.public.excel.misc
Steve-in-austin
 
Posts: n/a
Default From array find corresponding column/row value

Thanks Dave
I was working the index/match route but could not get the synatax right. Is
there a super Excel class where one can learn these tricks? I can't take much
more of the help files--I spent an hour before caving in and asking the
discussion group.

"Dave Peterson" wrote:

I put this in F2:
=IF(COUNTA(A2:E2)=0,"none!",INDEX($A$1:$E$1,MATCH( TRUE,A2:E2<"",0)))
And dragged down the column.

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Steve-in-austin wrote:

This seems so simple but...
I have an array (zero means blank in this example):
A B C D E
1 0 1 0 0 3
2 1 1 2 5 8
3 0 0 0 0 5
etc
How can I find the first non-blank cell in each row and return the column
heading as the result? e.g.
Row 1 = B
Row 2 = A
Row 3 = E


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default From array find corresponding column/row value

Hang around in the .worksheet.functions newsgroup and you'll pick up lots of
stuff.

It's scary how much those people can do.

Steve-in-austin wrote:

Thanks Dave
I was working the index/match route but could not get the synatax right. Is
there a super Excel class where one can learn these tricks? I can't take much
more of the help files--I spent an hour before caving in and asking the
discussion group.

"Dave Peterson" wrote:

I put this in F2:
=IF(COUNTA(A2:E2)=0,"none!",INDEX($A$1:$E$1,MATCH( TRUE,A2:E2<"",0)))
And dragged down the column.

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Steve-in-austin wrote:

This seems so simple but...
I have an array (zero means blank in this example):
A B C D E
1 0 1 0 0 3
2 1 1 2 5 8
3 0 0 0 0 5
etc
How can I find the first non-blank cell in each row and return the column
heading as the result? e.g.
Row 1 = B
Row 2 = A
Row 3 = E


--

Dave Peterson


--

Dave Peterson
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 find all matches in an array Greg Excel Discussion (Misc queries) 2 August 31st 05 09:04 PM
Find last occurance of text in range farutherford Excel Worksheet Functions 5 August 30th 05 02:00 AM
How do I find a value in an array (VLOOKUP? HLOOKUP?) M Skabialka New Users to Excel 2 March 11th 05 02:52 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 05:06 AM.

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"