Arrays

grantm15

New Member
Joined
Feb 7, 2005
Messages
3
I have a 2 columns of data. Sometimes, the second column has some blank cells due to a condition that I set. I want to list in another part of the spreadsheet, the values in the left hand column when that second column value is blank. In other words, if this was my data

january cold
february
March warm
April
May hot

I would want the formula to search this array and return February and April (the list of Column A values that has no value in column B) because the second column was blank.

Can somebody help!
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Assuming your data is in Columns A and B, respectively,

Try this in column C

=IF(ROW($B2)-ROW($B$1)>COUNTIF($B$1:$B$100,""),"",INDEX($A$1:$A$100,SMALL(IF($B$1:$B$100="",ROW($A$1:$A$100)),ROW($B2)-ROW($B$1))))


Adjust range to suit.
Must be confirmed with CTRL+SHIFT+ENTER instead of just ENTER.
Then copy down as far as your list is long.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
grantm15 said:
I have a 2 columns of data. Sometimes, the second column has some blank cells due to a condition that I set. I want to list in another part of the spreadsheet, the values in the left hand column when that second column value is blank. In other words, if this was my data

january cold
february
March warm
April
May hot

I would want the formula to search this array and return February and April (the list of Column A values that has no value in column B) because the second column was blank.

Can somebody help!
Book2
ABCDEFG
102
2Field-1Field-2IdxList
3januarycold february
4february1April
5Marchwarm  
6April2
7Mayhot 
8
Sheet1


C1 must house a 0.

C3, copied down:

=IF((A3<>"")*(B3=""),LOOKUP(9.99999999999999E+307,$C$1:C2)+1,"")

F1:

=LOOKUP(9.99999999999999E+307,C1:C7)

F3:

=IF(ROW()-ROW(F$3)+1<=$F$1,LOOKUP(ROW()-ROW(F$3)+1,$C$3:$C$7,$A$3:$A$7),"")
 

Watch MrExcel Video

Forum statistics

Threads
1,118,169
Messages
5,570,656
Members
412,335
Latest member
cinciri99
Top