Search vlookup more than 1 column

Bond00

Board Regular
Joined
Oct 11, 2017
Messages
142
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
So right now this function works and it searches another Doc filled with customer names in A2:A1500 range based off the partial value in C1
1728325955247.png

Excel Formula:
=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:A1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:A1),0),C1)
this formula is in C4 through C7 (i edited out the other cells) and reads the name from C1 as text to search

right now it searches another doc in col A but i'd like to also search col B2:B1500 and col C2:C1500 in that zCompany List.xlsx as well so it can pull data based on more options from the C1 cell

C1 pulls from somewhere else as well, so sometimes it gets a default value which is why i have it just default to C1 at the end if it doesn't find the searched name in the zCompany List doc, If i remember right i think the =IF(ISNUMBER is for that reason otherwise the C4-C7 cells become #N/A

So remember main goal, to change this formula so it can search A B or C col for data to pull in from the other doc (if it comes across a blank cell in those A-C columns just ignore)

thanks for any help!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try this array formula.
The range to look for is from A1 to C100, you can change 100 for a larger row number, but consider not putting a number that is too large, since it is a array formula and can be slow. So the recommendation is up to the number of rows you have in the zCompany List and maybe a little more slack. So where you see 100 you change it to that row number.

varios 07oct2024.xlsm
ABCD
1Mullinax
2
3
4Mullinax Ford
5
Sheet1
Cell Formulas
RangeFormula
C4C4=INDEX('[zCompany List.xlsx]Contacts for Tool'!$A$1:$C$100, MAX((ISNUMBER(SEARCH($C$1,'[zCompany List.xlsx]Contacts for Tool'!$A$1:$C$100)))*ROW($A$1:$A$100)), MAX((ISNUMBER(SEARCH($C$1,'[zCompany List.xlsx]Contacts for Tool'!$A$1:$C$100)))*COLUMN($A$2:$C$2)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Got this message, maybe because I'm using 2016?

1728366004661.png


Edit, wait neverminded I got it to work.
But its showing up some wrong data from another customer from another row.
Also is this supposed to be highlighting ranges in my main doc?
1728366269670.png

Excel Formula:
=INDEX('[zCompany List.xlsx]Contacts for Tool'!$A$2:$C$500,MAX((ISNUMBER(SEARCH($C$1,'[zCompany List.xlsx]Contacts for Tool'!$A$2:$C$500)))*ROW($A$2:$A$500)),MAX((ISNUMBER(SEARCH($C$1,'[zCompany List.xlsx]Contacts for Tool'!$A$2:$C$500)))*COLUMN($A$2:$C$2)))
changed the A1 to A2 since the top row is the headers of the table all the data is in from the other sheet its pulling from.
 
Last edited:
Upvote 0
Also it pulls the wrong data, its pulling from Col 3 and not col 1 which is the rest of the company name. Also that's an address from somewhere else.
1728366686793.png
 
Upvote 0
Also keep in mind i use this formula in many cells to auto pull and fill in data just by changing 1 address # in the formula in 2 spots. It would search col A for the key words and then pull from the columns A through M in the COLUMNS($A$1:B1) part of the function.
And if i choose to type something in the search that isn't in the list it will just show it there
Also note, Col A is empty in this sheet im working within.

Q00001 Mew - New Network, Server and Services - Copy - Copy.xlsm
BC
1Partial Search =Test
2
3SOLD TO:
4Company NameTest
5Contact Name 
6Address 
7City State Zip 
8Country 
9
10 Phone 
11 Fax 
12 Email 
Info for Quote
Cell Formulas
RangeFormula
C4C4=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:A1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:A1),0),C1)
C5C5=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:B1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:B1),0),"")
C6C6=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:C1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:C1),0),"")
C7C7=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:D1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:D1),0),"")
C8C8=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:E1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:E1),0),"")
C10C10=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:G1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:G1),0),"")
C11C11=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:H1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:H1),0),"")
C12C12=IF(ISNUMBER(SEARCH("",VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:I1),0))),VLOOKUP($C$1&"*",'[zCompany List.xlsx]Contacts for Tool'!$A$2:$L$1500,COLUMNS($A$1:I1),0),"")
 
Last edited:
Upvote 0
If you don't want to put A1, then you should subtract the row number where your data starts + 1

Dante Amor
ABCD
1mulli
2
3
4Mullinax Ford
5
Sheet1
Cell Formulas
RangeFormula
C4C4=INDEX('[zCompany List.xlsx]Contacts for Tool'!$A$2:$C$500, MAX((ISNUMBER(SEARCH($C$1,'[zCompany List.xlsx]Contacts for Tool'!$A$2:$C$500)))*ROW($A$2:$A$500))-ROW($A$2)+1, MAX((ISNUMBER(SEARCH($C$1,'[zCompany List.xlsx]Contacts for Tool'!$A$2:$C$500)))*COLUMN($A$2:$C$2)))
Press CTRL+SHIFT+ENTER to enter array formulas.


😇
 
Upvote 0
not sure why i get this result, i pasted your function in above without any changes. I just copy pasted it right in the cell in C4

When i copy in the code you sent in post #2 (no changes) it gave me info back from C3 in the zCompany List doc. and the Mulli name is on row 145 so it should have returned me A145 value

1728403056605.png


this is the full list of data it pulls from in the other sheet.
1728403347930.png
 
Last edited:
Upvote 0
Don't forget to enter the formula with Shift + Control + Enter (Not just Enter)
 
Upvote 0

Forum statistics

Threads
1,222,902
Messages
6,168,938
Members
452,227
Latest member
sam1121

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