Help making field BLANK/EMPTY when personalized search field is empty

Mmeneses

New Member
Joined
Aug 24, 2015
Messages
2
Hello
I used this formula to help me find a full match by writing down a partial string in an empty cell next to a contact list of the company I'm working for.

=IF(ISERROR(
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1)),"",
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1))

(pressed ctrl,shift,enter)

It worked! and I dragged the formula down so it would show all matches (like when typing max I would get in cell 1 maximiliano, the one below maxwell, etc). However, when I would leave the cell the formula used to do the search blank, it would fill in alphabetically (so in field it was blank ("") and in cell 1 I would get anna, then below brian, etc.).
Is there any way that I could make it so that when the search cell is blank, the results column will also be blank?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hello
I used this formula to help me find a full match by writing down a partial string in an empty cell next to a contact list of the company I'm working for.

=IF(ISERROR(
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1)),"",
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1))

(pressed ctrl,shift,enter)

It worked! and I dragged the formula down so it would show all matches (like when typing max I would get in cell 1 maximiliano, the one below maxwell, etc). However, when I would leave the cell the formula used to do the search blank, it would fill in alphabetically (so in field it was blank ("") and in cell 1 I would get anna, then below brian, etc.).
Is there any way that I could make it so that when the search cell is blank, the results column will also be blank?

Just have that condition in the front of your fomula

=if([search cell]="","",
IF(ISERROR(
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1)),"",
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1)))
 
Upvote 0
Just have that condition in the front of your fomula

=if([search cell]="","",
IF(ISERROR(
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1)),"",
INDEX($A$6:$A$153,IF(COUNTIF($A$6:$A$153,"*"&$F$6&"*")>=ROWS($F$6:$F6),SMALL(IF(ISNUMBER(SEARCH($F$6,$A$6:$A$153)),ROW($A$6:$A$153),""),ROWS($F$6:$F6))-5,""),1)))


Did you just realized what you did?!?!?!? You have absolutely made my day!!! thank you so much and hope you live happy forever!
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,825
Members
449,190
Latest member
rscraig11

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
Back
Top