Agent
Agent

Reputation: 133

In google sheets, using data validation, search for a given value in a multi-column range and if found, return all the values in a row

I have a set of customer data on a sheet, with first name, last name, customer number, etc:

A5      B5      C5
Amy     Zeehan  25487
Bree    Yantar  25488
Charli  Xavier  25489
Dante   Wilson  25490
Echo    Victor  25491

I want to be able to search for and return customer data from any of those customer details

I can successfully use data validation to get a searchable list of all the first name, last name, customer number etc, but I want to use something like vlookup to populate a form based on the found string. So for example, if I have data validation in A1, and I select 'Yantar' from that list, I want B1, B2 and B3 to populate with 'Bree', 'Yantar', and '25488' respectively.

One of my vLookup functions (in B1 for example) would look like:

=vlookup(C3, 'Customer List'!A5:C20, 1, FALSE)

However if I search for 'Yantar' in data validation, the vLookup doesn't return anything, because it can't find 'Yantar' in the FIRST column specified in its range (Which is column A)

Is this something that I can make work with vLookup, or should I be trying a different path with a different function?

Thanks!

Upvotes: 0

Views: 645

Answers (1)

TheMaster
TheMaster

Reputation: 50761

Try Query

=QUERY(A5:C20,"select * where A ='"&C3&"' or B= '"&C3&"' or C ='"&C3&"'  ")

Upvotes: 2

Related Questions