Database lookup

Beatrice

Board Regular
Joined
Sep 17, 2019
Messages
85
Office Version
  1. 2019
Platform
  1. Windows
I would like to create a table for user to look for the most similar Product Description.

Let say, they need to input 3 criteria:

1. text from a drop down list << need exact match
2. text from a drop down list << need exact match
3. number only << FIVE of the nearest match

* database will be stored as separated worksheets and locked for access control
* Excel version 2007

I tried below, but not working:
1. Data> Advance Filter
2. ARRAY Formula (index, match ...)

How can I make it happened?
Many thanks in advance for helping
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
See my reply to your original post.
 
Upvote 0
Thanks Ahoy, however the requirement is more difficult than yesterday...
I need to look for the nearest FIVE value.

Please see the example I created:
Capture.JPG


I am trying to understand how it works as the original database file are upto 100+ Column & 500+ row

example workbook

Thanks in advance for helping
 
Upvote 0
Maybe something like this:
Formula in B4 counts the number of items that match the users criteria. In your example 2 there are actual 6 items that match.
The formulas in Sheet2 cells B3, B4 and G10 are all array formulas that must be entered with CTRL-SHIFT-ENTER.
Drag the formula in G10 down the number of rows needed for your data.


Copy formula in D10 across and down as needed.

Sheet2
Book1
ABCDEFG
1Example 2
2
3Max Diff. of Top 515
4# of Items6
5
6
7User input:result:
8
9TYPEVALUETYPEBRANDVALUERow#
10Type B90Type BBrand 18011
11Type BBrand 110012
12Type BBrand 27515
13Type BBrand 28516
14Type BBrand 29517
15Type BBrand 210518
Sheet2
Cell Formulas
RangeFormula
B3B3{=SMALL(IF(Sheet1!$A$8:$A$26=$A$10,ABS(Sheet1!$C$8:$C$26-$B$10)),5)}
B4B4{=SUM(--(ISNUMBER(IF(Sheet1!$A$8:$A$26=$A$10,IF(ABS(Sheet1!$C$8:$C$26-$B$10)<=$B$3,ROW(Sheet1!$C$8:$C$26)-ROW(Sheet1!$C$8)+1)))))}
D10:F15D10=IF($G10="","",INDEX(Sheet1!$A$8:$C$26,$G10,MATCH(D$9,Sheet1!$A$7:$C$7,0)))
G10:G15G10{=IF(ROWS($G$10:G10)>$B$4,"",SMALL(IF(Sheet1!$A$8:$A$26=$A$10,IF(ABS(Sheet1!$C$8:$C$26-$B$10)<=$B$3,ROW(Sheet1!$C$8:$C$26)-ROW(Sheet1!$C$8)+1)),ROWS($G$10:G10)))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


Sheet1
Book1
ABC
1
2
3
4Database
5
6
7TYPEBRANDVALUE
8Type ABrand X210
9Type ABrand X230
10Type ABrand X250
11Type ABrand X300
12Type ABrand Y200
13Type ABrand Y250
14Type ABrand Y300
15Type ABrand Z240
16Type ABrand Z260
17Type ABrand Z280
18Type BBrand 180
19Type BBrand 1100
20Type BBrand 1120
21Type BBrand 1150
22Type BBrand 275
23Type BBrand 285
24Type BBrand 295
25Type BBrand 2105
26Type BBrand 2115
Sheet1
 
Upvote 0
Thanks Ahoy! You are a life saver !
I have modified B3 as variable , so user can set the "Tolerance" and get the closest results.
Many thanks for your help :)
 
Upvote 0

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

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