Comparing Columns 1 & 2 vs. Columns 3 & 4

bondra76

New Member
Joined
May 6, 2012
Messages
14
Got two sets of data that I want to compare against each other. Here's what the data sets look like -

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Contract #[/TD]
[TD]Supplier[/TD]
[TD]Approved?[/TD]
[TD]Service[/TD]
[TD]LookupKey[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC Company[/TD]
[TD]Yes[/TD]
[TD]Trash Removal[/TD]
[TD]1;Trash Removal[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC Company[/TD]
[TD]Yes[/TD]
[TD]Landscaping[/TD]
[TD]1; Landscaping[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Bobs Company[/TD]
[TD]No[/TD]
[TD]Landscaping[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]XYZ Company[/TD]
[TD]Yes[/TD]
[TD]Arborist[/TD]
[TD]3; Arborist[/TD]
[/TR]
</tbody>[/TABLE]

I created a lookupkey that's a simple if statement to check if the contract is approved; if it is then Contract # and service are combined and a lookup key is populated. I need to filter out the non-approved contracts.

In table 2, I am trying to illustrate what services the supplier is approved to do:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Contract #[/TD]
[TD]Supplier[/TD]
[TD]Arborist[/TD]
[TD]Landscaping[/TD]
[TD]Trash Removal[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]ABC Company[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Bobs Company[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]XYZ Company[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
</tbody>[/TABLE]

The TRUE/FALSE results are what I am after....

Right now I have the following formula in the TRUE/FALSE cells (C2:E:4) -
=SUMPRODUCT(--ISNUMBER(SEARCH(LookupKey,$A2&";"&C$1)))>0

I think the second part of my search formula is throwing everything off with the text joins, but not sure how else to do this. Maybe it's as simple as a formatting issue?

Thanks for any help in advance!!!!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Can this be done without the lookup key (everything matched in the sample but perhaps there's more)?


Excel 2010
ABCDE
1Contract #SupplierApproved?ServiceLookupKey
21ABC CompanyYesTrash Removal1;Trash Removal
31ABC CompanyYesLandscaping1; Landscaping
42Bobs CompanyNoLandscaping
53XYZ CompanyYesArborist3; Arborist
6
7
8Contract #SupplierArboristLandscapingTrash Removal
91ABC Company011
102Bobs Company000
113XYZ Company100
Sheet30
Cell Formulas
RangeFormula
C9=SUMPRODUCT(--($B$2:$B$5=$B9),--($D$2:$D$5=C$8),--($C$2:$C$5="Yes"))
 
Upvote 0
Pasting your first table into A1 of Sheet1 and the second into A1 or Sheet2 use this formula in C2 of Sheet2 and copy down and across:

=IFERROR(IF(LOOKUP(2,1/((Sheet1!$B:$B=$B2)*(Sheet1!$A:$A=$A2)*(Sheet1!$D:$D=C$1)),Sheet1!$C:$C)="Yes",TRUE,FALSE),FALSE)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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