Lookup value in multiple columns, and return a STRING of highest priority column

lamensterms

New Member
Joined
Apr 19, 2016
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hey guys,

I'm trying to search a value in multiple columns, and return a STRING if this value is found. The STRING depends on which column the value is found in.

I have 2 work sheets:
Sheet 1 = 'Items'
Sheet 2 = 'Location

On sheet 'Items', I have a list of values in Columns A. Some of these values are also listed on my second sheet 'Location', in columns A, B or C (not all values from 'Items' will be listed in 'Locations's columns), and some values will be listed in multiple columns on Sheet 2).

On Sheet 1 'Items', I would like Column B to search Sheet 2, and display a STRING/TEXT if the value is found. But the locations have a hierarchy. I wish to display the highest 'priority' Location that each Item is found in. Column C is the highest priority.

Sorry for the sloppy description, hopefully someone knows what I am trying to do.

I have experimented with nested IF and MATCH functions.

=IFERROR(IF(MATCH(A1,Location!C:C,0),"Installed"),IF(MATCH(A1,Location!B:B,0),"Delivered"),IF(MATCH(A1,Location!A:A,0),"Factory"),"")

...but I seem to be making an error somewhere (probably a simple syntax error).

Thanks for any help
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I think you need three IFERROR - something like (not tested)

=IFERROR(1st formula,IFERROR(2nd formula,IFERROR(3rd formula,"")))

M.
 
Upvote 0
Perfect, thanks so much for the reply Marcelo.. you were spot on.

Working formula:
=IFERROR(IF(MATCH(A1,Location!C:C,0),"Installed"),IFERROR(IF(MATCH(A1,Location!B:B,0),"Delivered"),IFERROR(IF(MATCH(A1,Location!A:A,0),"Factory"),"")))

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

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