Custom Search bar - Partial & Exact match

Eawyne

Board Regular
Joined
Jun 28, 2021
Messages
53
Office Version
  1. 2021
Platform
  1. Windows
Hiyall,

I've been trying to create a custom search bar and this video explaining it rather well. However, when it comes to the partial research, it appears that my version of Excel doesn't understand the [FIRST] variable (it's a Pro version 2021 - I thought it was enough, but maybe it needs 365 ?).

I wondered if there was a workaround ?
VBA Code:
=FILTER(Table1;Table1[First]=B13;"No match")

The basic formula requires an exact match, and it's quite limiting, unfortunately :
Code:
=FILTER(Table1;Table1[Sujet]=B13;"No match")
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
That First variable is a column in your table called Table1. Apparently your table does not have a column by that precise name
 
Upvote 0
Wow... I was so focused I didn't even notice that ! Granted, I tried downloading their file, but it's not even complete, and I just didn't think to reproduce their Table entirely... Thanks for helping me take a step back, I'm still learning Excel's formula structure.
 
Upvote 0
So I made it work - sorta. I think the formula is good, but in the video, he doesn't cover what's bothering me ; the "is empty" condition doesn't seem to trigger, and when my search box is empty, it shows up the whole list !

Code:
=FILTER(Table1;ISNUMBER(SEARCH(B13;Table1[Sujet]));"Rien trouvé")

I tried adding an ISBLANK but is doesn't do much either :
VBA Code:
=IF(ISBLANK(B13);"Rien
trouvé";FILTER(Table1;ISNUMBER(SEARCH(B13;Table1[Sujet]))))

EDIT : in the screenshots, the first "Rien trouvé" line is with the basic non-partial formula, where the "is empty" does trigger.
 

Attachments

  • Capture01.JPG
    Capture01.JPG
    46.1 KB · Views: 9
  • Capture02.JPG
    Capture02.JPG
    51.6 KB · Views: 9
Upvote 0
How about
Excel Formula:
=IF(B13="";"Rientrouvé";FILTER(Table1;ISNUMBER(SEARCH(B13;Table1[Sujet]));"Rientrouvé"))
 
Upvote 0
Well, that's kinda frustrating how easy it was. Why is it working with just IF and not IFBLANK (or empty) ?

Thanks, it works flowlessly.
 
Upvote 0
If B13 contains a formula, then it's not blank. I never use isblank for that reason.
 
Upvote 0
That's the thing though, B13 does not contain anything ! How peculiar... I'll dig into this later, again, thanks so much !
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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