Search for a value in either of two columns.

ChevyCorn

New Member
Joined
Oct 12, 2020
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Hi there,
I'm trying to search for a value in either column A or B and return the corresponding value in C. A and B values are not connected - I just want to offer two options to search. I don't think vlookup will work - any advice please?
Thanks!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Would this do what you want?

20 10 22.xlsm
ABCDEF
1Search ForResult
2Name 4Name 16Val 1Name 13Val 2
3Name 5Name 13Val 2Name 101Not found
4Name 6Name 10Val 3Name 1Val 5
5Name 3Name 11Val 4
6Name 1Name 14Val 5
7Name 2Name 12Val 6
8Name 7Name 15Val 7
Lookup 2 columns
Cell Formulas
RangeFormula
F2:F4F2=IFNA(VLOOKUP(E2,A$2:C$8,3,0),IFNA(VLOOKUP(E2,B$2:C$8,2,0),"Not found"))
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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