Lookup Function Based on 2 Cells in the Same Row

turner38

New Member
Joined
Jul 6, 2011
Messages
32
Hello All,

I am trying to find a way to verify that my worksheet contains a certain line of data.

Below is my worksheet:

Excel Workbook
ABC
1YearWeekPlace
2201122Florida
3201122Florida
4201123Florida
5201123Florida
6201122Idaho
7201122Idaho
8201123Idaho
9201123Idaho
10201124Florida
11201124Florida
12201125Florida
13201125Florida
Sheet1
Excel Workbook
DEFGH
1822232425
19XXXXFlorida
20XXMissingMissingIdaho
Excel 2007 I am wanting to know whether or not a certain row is included in my data set. I have a matrix below where I want to have a "X" if that row of data for that week exists for the corresponding State and "Missing" if there is no row of data for that week for that State. Sheet1
#VALUE!
Excel 2007
Cell Formulas
RangeFormula
D19=IF(INDEX($A$1:$A$13,MATCH(D18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
D20=IF(INDEX($A$1:$A$13,MATCH(D18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")
E19=IF(INDEX($A$1:$A$13,MATCH(E18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
E20=IF(INDEX($A$1:$A$13,MATCH(E18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")
F19=IF(INDEX($A$1:$A$13,MATCH(F18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
F20=IF(INDEX($A$1:$A$13,MATCH(F18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")
G19=IF(INDEX($A$1:$A$13,MATCH(G18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
G20=IF(INDEX($A$1:$A$13,MATCH(G18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")

Here is the result I am getting:

Excel Workbook
DEFGH
1822232425
19XXXXFlorida
20XXXXIdaho
Sheet1
Excel 2007
Cell Formulas
RangeFormula
D19=IF(INDEX($A$1:$A$13,MATCH(D18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
D20=IF(INDEX($A$1:$A$13,MATCH(D18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")
E19=IF(INDEX($A$1:$A$13,MATCH(E18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
E20=IF(INDEX($A$1:$A$13,MATCH(E18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")
F19=IF(INDEX($A$1:$A$13,MATCH(F18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
F20=IF(INDEX($A$1:$A$13,MATCH(F18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")
G19=IF(INDEX($A$1:$A$13,MATCH(G18,$B$1:$B$13,0),AND(MATCH($H$19,$C$1:$C$13,0)))=2011,"X","")
G20=IF(INDEX($A$1:$A$13,MATCH(G18,$B$1:$B$13,0),AND(MATCH($H$20,$C$1:$C$13,0)))=2011,"X","")

There should not be a "X" for Idaho for Weeks 24 and 25. Is this even possible to do with just formulas or would I need to go the VBA route?

Thanks for the help!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
If just Week and Place, try:

Code:
=IF(ISNUMBER(MATCH(1,IF($B$2:$B$13=D$18,IF($C$2:$C$13=$H19,1)),0)),"X","Missing")

Array entered in D19, i.e. with CTRL+SHIFT+ENTER, and then copied down and across.

Matty
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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