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

kcmuppet

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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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.
 
Upvote 0
Solution
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
 
Upvote 0
There are a few ways, I use left because it uses less functions / steps, making it more efficient with a large array.
 
Upvote 0
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))
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,426
Members
448,961
Latest member
nzskater

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