Logic Statements on Contains Function

Andrew_UK

Board Regular
Joined
Jun 3, 2015
Messages
53
Hi All,

I need a formula which tells me if another table contains a row which matches my criteria (if it helps I expect either 1 match or none)

Table 1 includes a tab which shows Invoice Month

[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer[/TD]
[TD]Invoice Month[/TD]
[TD]Other Data[/TD]
[TD]Discount Entitled[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Table 2 shows whether or not this customer is in

[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer[/TD]
[TD]Discount Start[/TD]
[TD]Discount End[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


So for instance the discount entitlement needs to read something like True/Fals and I imagine the formula will be along the lines of...

Contains(Table2, Customer, Customer, Invoice Month >= Related(Discount Start), Invoice Month <= Related(Discount End))

But I can't seem to get it working. The two tables are linked by customer

Thanks in advance for your help!!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
An "Events in Progress" pattern should apply here.

You could adapt Chris Webb's pattern here.
Also discussed in this paper on SQLBI (see page 27 for the optimized pattern).
 
Upvote 0

Forum statistics

Threads
1,226,735
Messages
6,192,733
Members
453,752
Latest member
Austin2222

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