How to get the value in multiple criteria of two columns ?

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
205
Office Version
  1. 2019
Platform
  1. Windows
I have data in Sheet1 and in Sheet2.
I have three columns in Sheet1 Bank, Branch,Branch Code in A B & C column.
In sheet2 I have Bank Branch Code in A B & C column
In C2 of Sheet1 I want that IF A2 and B2 matches the criteria it will get the Branch code from sheet2 Range A2:C100.


For example IF Sheet1 A2 is STATE BANK B2 is NEW DELHI
Sheet2 A2 is STATE BANK B2 is NEW DELHI C3 is STATE0005
Then I want the C2 of Sheet1 as STATE0005

I cant use VLOOKUP here because it uses two columns, may be index and match may work. what should be the formula ?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
With helper column
formula in sheet1 D2 copied down
=A2&B2

And then in sheet2 , the formula in C2 copied down is
=INDEX(Sheet1!C:C,MATCH(A2&B2,Sheet1!D:D,0))


Without helper column
in sheet2 ARRAY formula in C2 copied down
=INDEX(Sheet1!C:C,MATCH(A2&B2,Sheet1!A:A&Sheet1!B:B,0))

:warning: An array formula is committed with {CTRL}{SHIFT}{ENTER} and will then look like this
{=INDEX(Sheet1!C:C,MATCH(A2&B2,Sheet1!A:A&Sheet1!B:B,0))}
- does not work if you type in the { }


To target a specific range - all ranges must be same size (also an ARRAY formula)
=INDEX(Sheet1!C$2:C$5000,MATCH(A2&B2,Sheet1!A$2:A$5000&Sheet1!B$2:B$5000,0))
 
Last edited:
Upvote 0
With helper column
formula in sheet1 D2 copied down
=A2&B2

And then in sheet2 , the formula in C2 copied down is
=INDEX(Sheet1!C:C,MATCH(A2&B2,Sheet1!D:D,0))


Without helper column
in sheet2 ARRAY formula in C2 copied down
=INDEX(Sheet1!C:C,MATCH(A2&B2,Sheet1!A:A&Sheet1!B:B,0))

:warning: An array formula is committed with {CTRL}{SHIFT}{ENTER} and will then look like this
{=INDEX(Sheet1!C:C,MATCH(A2&B2,Sheet1!A:A&Sheet1!B:B,0))}
- does not work if you type in the { }


To target a specific range - all ranges must be same size (also an ARRAY formula)
=INDEX(Sheet1!C$2:C$5000,MATCH(A2&B2,Sheet1!A$2:A$5000&Sheet1!B$2:B$5000,0))

thank you
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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