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!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

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,210
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),"")
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,553
Messages
5,838,075
Members
430,527
Latest member
MyFace2

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
Top