# Index Match multiple 'AND' criteria plus "Or" / partial match criterion

#### kcmuppet

##### Active Member
Hello I have an Index and Match formula that returns the date of an event if matches all these criteria

Excel Formula:
=INDEX(tbl_Events[Event Date],MATCH(1,
(tbl_Events[Patient Number]=[@[Patient Number]])*
(tbl_Events[Event]="Diagnosed Cancer")*
(tbl_Events[Event Date]>=ReportStartDate)*
(tbl_Events[Event Date]<=ReportEndDate),0))

What is the right syntax to change the text criterion to include partial matches?

I tried to modify it to find either "Diagnosed Cancer" or "Diagnosed Not Cancer" like this:

Excel Formula:
=INDEX(tbl_Events[Event Date],MATCH(1,
(tbl_Events[Patient Number]=[@[Patient Number]])*
(tbl_Events[Event]="Diagnosed*")*
(tbl_Events[Event Date]>=ReportStartDate)*
(tbl_Events[Event Date]<=ReportEndDate),0))

But it returned no results (#N/A) even though the data exists and for each Patient in the list the it can only be one of the other Diagnosis.

Thanks

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

#### jasonb75

##### Well-known Member
The * character doesn't work as a wildcard in that situation, the formula will be looking for an actual * in the cells.

You would need to use (LEFT(tbl_Events[Event],9)="Diagnosed") for it to work.

#### kcmuppet

##### Active Member
The * character doesn't work as a wildcard in that situation, the formula will be looking for an actual * in the cells.

You would need to use (LEFT(tbl_Events[Event],9)="Diagnosed") for it to work.

Thank you. I also found that (ISNUMBER(SEARCH("Diagnosed",tbl_Events[Event]))) also worked

#### jasonb75

##### Well-known Member
There are a few ways, I use left because it uses less functions / steps, making it more efficient with a large array.

#### kcmuppet

##### Active Member
Thank you both,

Updating here to show all three solutions for completeness

Book1
ABC
1FruitNumberCondition 2
2Apples5TRUE
3Pears29TRUE
4Pears29TRUE
5Tomatoes4FALSE
6
7Average of column B21
8Desired average of column B ignoring duplicate in Column A17using Dynamic Array formulae
917using Frequency
1017without Frequency or Dynamic Array formulae
Sheet1
Cell Formulas
RangeFormula
B7B7=AVERAGEIF(Table1[Condition 2],TRUE,Table1[Number])
B8B8=AVERAGE(UNIQUE(FILTER(Table1[[Fruit]:[Number]],Table1[Condition 2])))

Replies
3
Views
203
Replies
1
Views
131
Replies
1
Views
357
Replies
3
Views
208
Replies
1
Views
524

1,127,861
Messages
5,627,314
Members
416,239
Latest member
Counselor85027

### 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.

### Which adblocker are you using?

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

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