Lookup data in another tab based on multiple criteria

Paul36

New Member
Joined
Jul 9, 2010
Messages
12
Hi I need help to look up data in another tab based on multiple criteria.

As an example, lets say in Sheet 1, I have the following data:
A1 = month (eg 5 for May)
A2 = Code Number 1
A3 = Code Number 2

In Sheet 2, I have the data:
A2 = Code Number 1
A3 = Code Number 2

In Sheet 2, from B1 to B13 is the months of the year (1-12)
And also B2 to B13 are the values for Code Number 1 for each of these months (and C2 to C13 are values for Code Number 2 etc).

So back in Sheet 1, I want to have a formula that returns in Cell B2 the value for the Code Number 1 that is in the relevant month in sheet 2. In Sheet 1, I need to reference the Code Number and current month, and then based on these 2 criteria, search for the correct value in Sheet 2 that has the same month and Code Number.

So if I input "4" in Cell A1 in Sheet 1, this would mean it is April. The formula in Sheet 1, Cell B2 would then look in Sheet 2 and return the value for that Code Number for April.

Hope this makes sense. It is doing my head in! ANy help much appreciated
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Sorry, I messed up in my explanation of Sheet 2.

It should read:

In Sheet 2, from B1 to M1 is the months of the year (1-12)
And also B2 to M2 are the values for Code Number 1 for each of these months (and B3 to M3 are values for Code Number 2 etc)

I would post a copy of my tabs but not sure how to do that, sorry!
 
Upvote 0
Sorry, I messed up in my explanation of Sheet 2.

It should read:

In Sheet 2, from B1 to M1 is the months of the year (1-12)
And also B2 to M2 are the values for Code Number 1 for each of these months (and B3 to M3 are values for Code Number 2 etc)

I would post a copy of my tabs but not sure how to do that, sorry!

B2, Sheet1
Code:
=INDEX(Sheet2!$B$2:$M$100,
    MATCH(A2,Sheet2!$A$2:$A$100,0),
    MATCH($A$1,Sheet2!$B$1:$M$1,0))

which can be copied down for the rest of the look up
values in A3 and downwards.
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

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