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

kcmuppet

Active Member
Joined
Nov 2, 2005
Messages
272
Office Version
  1. 365
  2. 2010
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
 

Some videos you may like

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
Joined
Dec 30, 2008
Messages
12,488
Office Version
  1. 365
Platform
  1. Windows
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.
 
Solution

kcmuppet

Active Member
Joined
Nov 2, 2005
Messages
272
Office Version
  1. 365
  2. 2010
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
Joined
Dec 30, 2008
Messages
12,488
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Nov 2, 2005
Messages
272
Office Version
  1. 365
  2. 2010
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])))
B9B9=AVERAGE(IF(FREQUENCY(IF(Table1[Condition 2]=TRUE,MATCH(Table1[Fruit],Table1[Fruit],0)),ROW(Table1[Fruit])-ROW(Table1[[#Headers],[Fruit]]))>0,Table1[Number]))
B10B10=AVERAGE(IFERROR(Table1[Number]/((ROW(Table1[Fruit])-ROW(Table1[[#Headers],[Fruit]]))=MATCH(Table1[Fruit],Table1[Fruit],0))/Table1[Condition 2],FALSE))
 

Watch MrExcel Video

Forum statistics

Threads
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.
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
Top